Permalink
Browse files

test the deprecation warning

  • Loading branch information...
1 parent 215841c commit 1ed1a71f7625742925f200d0f6cc63828b310e48 @doy doy committed Jan 2, 2013
Showing with 21 additions and 0 deletions.
  1. +21 −0 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.