capture origin/<name> of active branch in case remote is not tracked
[scpubgit/System-Introspector.git] / t / hosts.t
CommitLineData
6bc93875 1use strictures 1;
2use Test::More;
3use FindBin;
4
afd7c030 5use System::Introspector::Probe::Hosts;
6bc93875 6
afd7c030 7my $probe = System::Introspector::Probe::Hosts->new(
6bc93875 8 hosts_file => "$FindBin::Bin/data/hosts",
9);
505ca707 10
11my $result = $probe->gather;
12ok $result, 'received data';
5a9311b3 13my $data = $result->{hosts_file};
505ca707 14ok $data, 'received hosts data';
6bc93875 15
5a9311b3 16is $result->{__error__}, undef, 'no errors';
17ok $data->{file_name}, 'received file name';
18
19my $body = $data->{body};
20ok $body, 'received a body';
21like $body, qr{1.2.3.4\s+foo\s+bar}, 'first host';
22like $body, qr{2.3.4.5\s+bar}, 'second host';
23like $body, qr{some comment}, 'comment preserved';
6bc93875 24
25done_testing;