Beam-Wire
view release on metacpan or search on metacpan
t/exception.t view on Meta::CPAN
subtest "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.617 second using v1.01-cache-2.11-cpan-cc502c75498 )