X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fresolvconf.t;h=9d2d773a081c028c884d21c6ea87763d8dbac338;hb=ff4d9e13b7a10316ae73a025d173f8c34f0230a3;hp=4d927f05b3465708a4bcd3566511096091d773ac;hpb=c0159b01430de919b7d94f0665bdceb1fe0b4282;p=scpubgit%2FSystem-Introspector.git diff --git a/t/resolvconf.t b/t/resolvconf.t index 4d927f0..9d2d773 100644 --- a/t/resolvconf.t +++ b/t/resolvconf.t @@ -2,21 +2,23 @@ use strictures 1; use Test::More; use FindBin; -use System::Introspector::ResolvConf; +use System::Introspector::Probe::ResolvConf; -my $probe = System::Introspector::ResolvConf->new( +my $probe = System::Introspector::Probe::ResolvConf->new( resolv_conf_file => "$FindBin::Bin/data/resolv.conf", ); my $result = $probe->gather; ok $result, 'received data'; -my $data = $result->{resolv_conf}; +my $data = $result->{resolv_conf_file}; ok $data, 'received resolv.conf data'; -is_deeply $data, - [[qw( domain foo )], - [qw( search bar )], - [qw( nameserver baz )], - [qw( nameserver qux )]], - 'parsing worked'; +is $data->{__error__}, undef, 'no errors'; +ok $data->{file_name}, 'received file name'; +ok $data->{body}, 'received file body'; + +like $data->{body}, qr{domain\s+foo}, 'domain specification'; +like $data->{body}, qr{search\s+bar}, 'search specification'; +like $data->{body}, qr{nameserver\s+baz}, 'first nameserver specification'; +like $data->{body}, qr{nameserver\s+qux}, 'second nameserver specification'; done_testing;