From c59b69005af224a126f1ffaa014c44fc2474542f Mon Sep 17 00:00:00 2001 From: Andreas Guldstrand Date: Thu, 2 Jun 2016 00:01:33 +0200 Subject: 20-config.t: add test for error message if /etc/sbotools can't be mkdir()d --- t/20-config.t | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 't') 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; +} -- cgit v1.2.3