[libbread-board-perl] 27/66: test the deprecation warning
Jonas Smedegaard
js at alioth.debian.org
Sun Sep 29 21:23:35 UTC 2013
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository libbread-board-perl.
commit f6b4ee6df37f90ef0eaeb42ec55a5809848affc1
Author: Jesse Luehrs <doy at tozt.net>
Date: Wed Jan 2 09:21:20 2013 -0600
test the deprecation warning
---
t/302_path_traversal_deprecation.t | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/t/302_path_traversal_deprecation.t b/t/302_path_traversal_deprecation.t
new file mode 100644
index 0000000..4d75a40
--- /dev/null
+++ b/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;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libbread-board-perl.git
More information about the Pkg-perl-cvs-commits
mailing list