equal
deleted
inserted
replaced
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 { |