t/00-basic.t
changeset 20 2c6f22539c7f
parent 19 7c5787eaccb5
child 23 c52bb12b3ed0
equal deleted inserted replaced
19:7c5787eaccb5 20:2c6f22539c7f
     1 use Test::More qw(no_plan);
     1 use Test::More qw(no_plan);
     2 use Test::Exception;
     2 use Test::Exception;
     3 
     3 
     4 use_ok 'Nagios::Check::DNS::check_tlsa_record';
     4 use_ok 'Nagios::Check::DNS::check_tlsa_record' or BAIL_OUT;
     5 can_ok 'Nagios::Check::DNS::check_tlsa_record', qw(dig_tlsa);
     5 can_ok 'Nagios::Check::DNS::check_tlsa_record', qw(dig_tlsa) or BAIL_OUT;
     6 
     6 
     7 # The above package doesn't use the Exporter currently, for shortcut
     7 # The above package doesn't use the Exporter currently, for shortcut
     8 # reasons we import the relevant subs into *this* module
     8 # reasons we import the relevant subs into *this* module
     9 *dig_tlsa = \&Nagios::Check::DNS::check_tlsa_record::dig_tlsa;
     9 *dig_tlsa = \&Nagios::Check::DNS::check_tlsa_record::dig_tlsa;
    10 
    10 
    11 # API conformance
    11 # API conformance
    12 subtest 'API' => sub {
    12 subtest 'API' => sub {
    13     can_ok 'Nagios::Check::DNS::check_tlsa_record', qw(dig_tlsa);
       
    14     dies_ok { dig_tlsa('example.org') } 'API: dig_tlsa() missing port';
    13     dies_ok { dig_tlsa('example.org') } 'API: dig_tlsa() missing port';
    15 };
    14 };
    16 
    15 
    17 # get and compare the TLSA records via dig_tlsa with `dig …`
    16 # get and compare the TLSA records via dig_tlsa with `dig …`
    18 subtest 'Data' => sub {
    17 subtest 'Data' => sub {