Removed outdated during-development tool
[scpubgit/System-Introspector.git] / t / hosts.t
index ed6c1e9..a7c7a43 100644 (file)
--- a/t/hosts.t
+++ b/t/hosts.t
@@ -2,15 +2,24 @@ use strictures 1;
 use Test::More;
 use FindBin;
 
-use System::Introspector::Hosts;
+use System::Introspector::Probe::Hosts;
 
-my $probe = System::Introspector::Hosts->new(
+my $probe = System::Introspector::Probe::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';
+my $result = $probe->gather;
+ok $result, 'received data';
+my $data = $result->{hosts_file};
+ok $data, 'received hosts data';
+
+is $result->{__error__}, undef, 'no errors';
+ok $data->{file_name}, 'received file name';
+
+my $body = $data->{body};
+ok $body, 'received a body';
+like $body, qr{1.2.3.4\s+foo\s+bar}, 'first host';
+like $body, qr{2.3.4.5\s+bar}, 'second host';
+like $body, qr{some comment}, 'comment preserved';
 
 done_testing;