X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fresolvconf.t;h=9d2d773a081c028c884d21c6ea87763d8dbac338;hb=ff4d9e13b7a10316ae73a025d173f8c34f0230a3;hp=79839e5f4f8ceb00d5d907785d921e55e49a76a3;hpb=94fb29f6d10bdfbeb8e6382e2009c79bc4b053e0;p=scpubgit%2FSystem-Introspector.git diff --git a/t/resolvconf.t b/t/resolvconf.t index 79839e5..9d2d773 100644 --- a/t/resolvconf.t +++ b/t/resolvconf.t @@ -2,18 +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 $data = $probe->gather; +my $result = $probe->gather; +ok $result, 'received data'; +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;