diff options
-rwxr-xr-x | t/20-config.t | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/t/20-config.t b/t/20-config.t index 330a0c3..8d65ad4 100755 --- a/t/20-config.t +++ b/t/20-config.t @@ -8,7 +8,7 @@ use FindBin '$RealBin'; use lib $RealBin; use Test::Sbotools qw/ sboconfig /; -plan tests => 17; +plan tests => 20; # 1-7: test invalid arguments sboconfig '-c', 'invalid', { exit => 1, expected => "You have provided an invalid parameter for -c\n" }; @@ -21,7 +21,7 @@ sboconfig '-V', 'invalid', { exit => 1, expected => "You have provided an invali # 8-9: move original dir away and run tests on the config file SKIP: { - skip "Only run this test under Travis CI", 10 unless $ENV{TRAVIS}; + skip "Only run this test under Travis CI", 13 unless $ENV{TRAVIS}; my $dir = '/etc/sbotools'; rename $dir, "$dir.moved"; @@ -41,7 +41,7 @@ SKIP: { my $err = $!; fail "Writing sbotools.conf"; diag "Could not open $dir/sbotools.conf for writing: $err"; - skip 7, "Could not write sbotools.conf"; + skip 10, "Could not write sbotools.conf"; goto CLEANUP; }; @@ -63,7 +63,7 @@ SKIP: { my $err = $!; fail "Reading sbotools.conf"; diag "Could not open $dir/sbotools.conf for reading: $err"; - skip 7, "Could not read sbotools.conf"; + skip 10, "Could not read sbotools.conf"; goto CLEANUP; }; @@ -80,6 +80,24 @@ SKIP: { is($lines[6], "SLACKWARE_VERSION=14.1", "SLACKWARE_VERSION correctly set."); is($lines[7], undef, "SLACKWARE_VERSION correctly collapsed."); + sboconfig qw[ -V 14.0 -j 2 ], { test => 0 }; + + open $cfh, '<', "$dir/sbotools.conf" or do { + my $err = $!; + fail "Reading sbotools.conf"; + diag "Could not open $dir/sbotools.conf for reading: $err"; + skip 3, "Could not read sbotools.conf"; + goto CLEANUP; + }; + + chomp(@lines = readline $cfh); + + close $cfh; + + is($lines[6], "SLACKWARE_VERSION=14.0", "SLACKWARE_VERSION correctly set again."); + is($lines[7], "JOBS=2", "JOBS correctly set."); + is($lines[8], undef, "Nothing new collapsed."); + CLEANUP: unlink "$dir/sbotools.conf"; rmdir $dir; |