diff options
author | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2016-06-02 00:01:33 +0200 |
---|---|---|
committer | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2016-06-02 00:01:33 +0200 |
commit | c59b69005af224a126f1ffaa014c44fc2474542f (patch) | |
tree | dd12c442f48f6961e4c959bfa1aa6ccf7d65df37 | |
parent | 22f718a96ddc7a1ea9e4bf9bc9deea7e08cef075 (diff) | |
download | sbotools2-c59b69005af224a126f1ffaa014c44fc2474542f.tar.xz |
20-config.t: add test for error message if /etc/sbotools can't be mkdir()d
-rwxr-xr-x | t/20-config.t | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/t/20-config.t b/t/20-config.t index 9f1d48c..622ceea 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 => 7; +plan tests => 8; sboconfig '-c', 'invalid', { exit => 1, expected => "You have provided an invalid parameter for -c\n" }; sboconfig '-d', 'invalid', { exit => 1, expected => "You have provided an invalid parameter for -d\n" }; @@ -17,3 +17,16 @@ sboconfig '-p', 'invalid', { exit => 1, expected => "You have provided an invali sboconfig '-s', 'invalid', { exit => 1, expected => "You have provided an invalid parameter for -s\n" }; sboconfig '-o', 'invalid', { exit => 1, expected => "You have provided an invalid parameter for -o\n" }; sboconfig '-V', 'invalid', { exit => 1, expected => "You have provided an invalid parameter for -V\n" }; + +SKIP: { + skip "Only run this test under Travis CI", 1 unless $ENV{TRAVIS}; + + my $dir = '/etc/sbotools'; + system 'mv', $dir, "$dir.moved"; + system 'touch', $dir; + + sboconfig '-V', '14.1', { exit => 1, expected => qr"\QUnable to create $dir. Exiting." }; + + system 'rm', $dir; + system 'mv', "$dir.moved", $dir; +} |