diff options
author | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2016-06-04 18:40:19 +0200 |
---|---|---|
committer | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2016-06-04 18:40:19 +0200 |
commit | fda0360e34556d205ea05f2bbe5671679b3e7129 (patch) | |
tree | c003b3217abeb0b294e3c3008877ec1434488124 | |
parent | 5d23bbb5608ef6f09d3ebf370832fd635cf7bc29 (diff) | |
download | sbotools2-fda0360e34556d205ea05f2bbe5671679b3e7129.tar.xz |
01-unit.t: add sboconfig unit testing
-rwxr-xr-x | t/01-unit.t | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/t/01-unit.t b/t/01-unit.t index ab3a6e8..1c29de2 100755 --- a/t/01-unit.t +++ b/t/01-unit.t @@ -11,7 +11,7 @@ use Capture::Tiny qw/ capture_merged /; use File::Temp 'tempdir'; use Cwd; -plan tests => 59; +plan tests => 61; sub load { my ($script, %opts) = @_; @@ -340,3 +340,15 @@ SKIP: { is ($out, "A fatal script error has occurred:\nremove_stuff requires an argument.\nExiting.\n", "sboclean's remove_stuff() gave correct output"); is ($exit, 2, "sboclean's remove_stuff() gave correct exit status"); } + +# 60-61: sboconfig unit tests... +{ + local (*main::show_usage, *main::config_write); + load('sboconfig'); + + my $exit; + my $out = capture_merged { $exit = exit_code { main::config_write(); }; }; + + is ($out, "A fatal script error has occurred:\nconfig_write requires two arguments.\nExiting.\n", "sboconfig's config_write() gave correct output"); + is ($exit, 2, "sboconfig's config_write() gave correct exit status"); +} |