Beam-Wire
view release on metacpan or search on metacpan
t/exception.t view on Meta::CPAN
2526272829303132333435363738394041424344454647subtest
"get a service that doesn't exist"
=>
sub
{
my
$wire
= Beam::Wire->new;
throws_ok {
$wire
->get(
'foo'
) }
'Beam::Wire::Exception::NotFound'
;
is $@->name,
'foo'
;
like $@,
qr{\QService 'foo' not found}
,
'stringifies'
;
subtest
'not found with file shows file name'
=>
sub
{
my
$path
=
$SHARE_DIR
->child(
'file.yml'
)->stringify;
my
$wire
= Beam::Wire->new(
file
=>
$path
);
throws_ok {
$wire
->get(
'does_not_exist'
) }
'Beam::Wire::Exception::NotFound'
;
is $@->name,
'does_not_exist'
;
like $@,
qr{\QService 'does_not_exist' not found in file '$path'}
,
'stringifies'
;
};
};
subtest
"extend a service that doesn't exist"
=>
sub
{
my
$wire
= Beam::Wire->new(
config
=> {
foo
=> {
extends
=>
'bar'
,
},
},
( run in 0.288 second using v1.01-cache-2.11-cpan-a9ef4e587e4 )