added lines_from_command util
[scpubgit/System-Introspector.git] / t / mountpoints.t
1 use strictures 1;
2 use Test::More;
3
4 use System::Introspector::MountPoints;
5
6 my $probe = System::Introspector::MountPoints->new;
7 my $data  = $probe->gather;
8
9 ok $data->{fstab}, 'received fstab data';
10 ok $data->{mtab},  'received mtab data';
11
12 my @fields = qw(
13     device_name
14     dump_freq
15     fs_type
16     mount_point
17     options
18     pass_num
19 );
20
21 my $run_test = sub {
22     my $tab = shift;
23     return sub {
24         for my $field (@fields) {
25             ok not(grep { not defined $_->{$field} } @$tab),
26                 "all have $field";
27         }
28     };
29 };
30
31 subtest fstab => $run_test->($data->{fstab});
32 subtest mtab => $run_test->($data->{mtab});
33
34 done_testing;