simplified ResolvConf probe output and make it conform to standard file data structure
[scpubgit/System-Introspector.git] / t / resolvconf.t
CommitLineData
94fb29f6 1use strictures 1;
2use Test::More;
3use FindBin;
4
afd7c030 5use System::Introspector::Probe::ResolvConf;
94fb29f6 6
afd7c030 7my $probe = System::Introspector::Probe::ResolvConf->new(
94fb29f6 8 resolv_conf_file => "$FindBin::Bin/data/resolv.conf",
9);
c0159b01 10my $result = $probe->gather;
11ok $result, 'received data';
13642dda 12my $data = $result->{resolv_conf_file};
c0159b01 13ok $data, 'received resolv.conf data';
94fb29f6 14
13642dda 15is $data->{__error__}, undef, 'no errors';
16ok $data->{file_name}, 'received file name';
17ok $data->{body}, 'received file body';
18
19like $data->{body}, qr{domain\s+foo}, 'domain specification';
20like $data->{body}, qr{search\s+bar}, 'search specification';
21like $data->{body}, qr{nameserver\s+baz}, 'first nameserver specification';
22like $data->{body}, qr{nameserver\s+qux}, 'second nameserver specification';
94fb29f6 23
24done_testing;