File: 302_path_traversal_deprecation.t

package info (click to toggle)
libbread-board-perl 0.29-1~bpo70%2B1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports
  • size: 620 kB
  • sloc: perl: 5,280; makefile: 13
file content (21 lines) | stat: -rw-r--r-- 441 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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;