From: Robert 'phaylon' Sedlacek Date: Tue, 8 May 2012 18:45:58 +0000 (+0000) Subject: Hosts probe tests X-Git-Tag: v0.001_001~117 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6bc93875f233f8e50949eb17b9da929514a34798;p=scpubgit%2FSystem-Introspector.git Hosts probe tests --- diff --git a/t/data/hosts b/t/data/hosts new file mode 100644 index 0000000..1711790 --- /dev/null +++ b/t/data/hosts @@ -0,0 +1,4 @@ +1.2.3.4 foo bar + +# another one +2.3.4.5 bar diff --git a/t/hosts.t b/t/hosts.t new file mode 100644 index 0000000..ed6c1e9 --- /dev/null +++ b/t/hosts.t @@ -0,0 +1,16 @@ +use strictures 1; +use Test::More; +use FindBin; + +use System::Introspector::Hosts; + +my $probe = System::Introspector::Hosts->new( + hosts_file => "$FindBin::Bin/data/hosts", +); +my $data = $probe->gather; + +is_deeply $data, + [['1.2.3.4', qw( foo bar )], ['2.3.4.5', 'bar']], + 'parsing worked'; + +done_testing;