sbotools2

Maintenance fork of the original sbotools version 2
Log | Files | Refs | README

commit 3c3e097a8175744053d33ef78e7b9147c198e93c
parent 110b95d87cd2c1507115c242e37d3129731adbbf
Author: Andreas Guldstrand <andreas.guldstrand@gmail.com>
Date:   Wed,  4 May 2016 01:43:10 +0200

12-readme.t: add tests for invalid options

Diffstat:
Mt/12-readme.t | 8++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/t/12-readme.t b/t/12-readme.t @@ -10,7 +10,7 @@ use lib $RealBin; use Test::Sbotools qw/ make_slackbuilds_txt set_lo sboinstall sboremove /; if ($ENV{TEST_INSTALL}) { - plan tests => 8; + plan tests => 10; } else { plan skip_all => 'Only run these tests if TEST_INSTALL=1'; } @@ -52,7 +52,11 @@ sboremove 'envsettingtest2', { input => "n\ny\ny\ny", test => 0 }; # 6: sboinstall envsettingtest - don't supply an option even if you say you intend to sboinstall 'envsettingtest', { input => "y\n\nn", expected => qr/Please supply any options here/ }; -# 7-8: sboinstall commandinreadme +# 7-8: supply an erroneous option +sboinstall 'envsettingtest', { input => "y\nFOO\nFOO=bar\nn", expected => qr/Invalid input received[.]/ }; +sboinstall 'envsettingtest', { input => "y\nFOO\n\nn", expected => qr/Invalid input received[.]/ }; + +# 9-10: sboinstall commandinreadme SKIP: { skip "Only run useradd/groupadd commands under Travis CI", 2 unless (defined $ENV{TRAVIS} and $ENV{TRAVIS} eq 'true'); skip "Only run useradd/groupadd commands if there is no test user/group", 2, if (defined getgrnam('test') or defined getpwnam('test'));