Skip to content

Commit

Permalink
test the deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
doy committed Jan 2, 2013
1 parent 215841c commit 1ed1a71
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions t/302_path_traversal_deprecation.t
@@ -0,0 +1,21 @@
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More;

use Bread::Board;

my $c = container 'Foo' => as {
service bar => 'baz';
};

{
my $warning;
local $SIG{__WARN__} = sub { $warning = $_[0] };

my $baz = $c->resolve(service => '/Foo/bar');
is($baz, 'baz');
like($warning, qr/Traversing into the current container \(Foo\) is deprecated; you should remove the Foo component from the path/);
}

done_testing;

0 comments on commit 1ed1a71

Please sign in to comment.