ResolvConf probe tests
Robert 'phaylon' Sedlacek [Tue, 8 May 2012 18:59:47 +0000 (18:59 +0000)]
t/data/resolv.conf [new file with mode: 0644]
t/resolvconf.t [new file with mode: 0644]

diff --git a/t/data/resolv.conf b/t/data/resolv.conf
new file mode 100644 (file)
index 0000000..a5d0c90
--- /dev/null
@@ -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 (file)
index 0000000..79839e5
--- /dev/null
@@ -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;