File: 02-perm.t

package info (click to toggle)
libconfig-scoped-perl 0.12-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 752 kB
  • ctags: 73
  • sloc: perl: 10,347; makefile: 42
file content (18 lines) | stat: -rw-r--r-- 488 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# vim: cindent ft=perl

# change 'tests => 1' to 'tests => last_test_to_print';
use warnings;
use strict;

use Test::More tests => 4;
use File::Spec;

BEGIN { use_ok('Config::Scoped') }
my $unsafe_cfg = File::Spec->catfile( 't', 'files', 'fvalid.cfg' );
chmod 0664, $unsafe_cfg;
my ($p, $cfg);
isa_ok($p = Config::Scoped->new(file => $unsafe_cfg), 'Config::Scoped');

eval { $cfg = $p->parse; };
isa_ok($@, 'Config::Scoped::Error::Validate::Permissions');
like($@, qr/is unsafe/i, "$@");