t/00-basic.t
changeset 40 d0410b54a231
parent 21 2247be0e2a13
equal deleted inserted replaced
39:2721e331ea42 40:d0410b54a231
     5 use Test::Exception;
     5 use Test::Exception;
     6 use English qw(-no_match_vars);
     6 use English qw(-no_match_vars);
     7 
     7 
     8 package FOO;
     8 package FOO;
     9 ::require_ok 'blib/nagios/plugins/ius/check_amanda-client';
     9 ::require_ok 'blib/nagios/plugins/ius/check_amanda-client';
       
    10 FOO->import;
    10 
    11 
    11 package main;
    12 package main;
    12 
    13 
    13 subtest 'find_tool' => sub {
    14 subtest 'find_tool' => sub {
    14     is FOO::find_tool('sh'), '/bin/sh' => 'found /bin/sh';
    15     is FOO::find_tool('sh'), '/bin/sh' => 'found /bin/sh';
    53     is_deeply [sort { $a->[0] cmp $b->[0] } FOO::get_devices()],
    54     is_deeply [sort { $a->[0] cmp $b->[0] } FOO::get_devices()],
    54       \@devs => 'got the proper devices';
    55       \@devs => 'got the proper devices';
    55 
    56 
    56 };
    57 };
    57 
    58 
       
    59 subtest 'su' => sub {
       
    60     is_deeply [FOO::su('root')], [0, 0], 'su to root';
       
    61 };
       
    62 
    58 done_testing;
    63 done_testing;