From: Robert 'phaylon' Sedlacek Date: Tue, 8 May 2012 18:59:47 +0000 (+0000) Subject: ResolvConf probe tests X-Git-Tag: v0.001_001~115 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=94fb29f6d10bdfbeb8e6382e2009c79bc4b053e0;p=scpubgit%2FSystem-Introspector.git ResolvConf probe tests --- diff --git a/t/data/resolv.conf b/t/data/resolv.conf new file mode 100644 index 0000000..a5d0c90 --- /dev/null +++ b/t/data/resolv.conf @@ -0,0 +1,4 @@ +domain foo +search bar +nameserver baz +nameserver qux diff --git a/t/resolvconf.t b/t/resolvconf.t new file mode 100644 index 0000000..79839e5 --- /dev/null +++ b/t/resolvconf.t @@ -0,0 +1,19 @@ +use strictures 1; +use Test::More; +use FindBin; + +use System::Introspector::ResolvConf; + +my $probe = System::Introspector::ResolvConf->new( + resolv_conf_file => "$FindBin::Bin/data/resolv.conf", +); +my $data = $probe->gather; + +is_deeply $data, + [[qw( domain foo )], + [qw( search bar )], + [qw( nameserver baz )], + [qw( nameserver qux )]], + 'parsing worked'; + +done_testing;