commit b1cb06a0f5be35d045c96abf55eb686eb45ffecc
parent 2d455ad7edce74f303fe09c5faea50f6a00a2bec
Author: Natasha Kerensikova <natgh@instinctive.eu>
Date: Sat, 9 Nov 2024 16:37:52 +0000
Pad the integrated test suite to reach full coverage
Diffstat:
2 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/Makefile b/Makefile
@@ -42,6 +42,7 @@ cov2:
shellspec --kcov -s bash \
spec/pass_spec.sh \
spec/pashage_extra_spec.sh
+ grep -q '"covered":"100.0"' coverage/index.js
tests:
shellspec
diff --git a/spec/pashage_extra_spec.sh b/spec/pashage_extra_spec.sh
@@ -1547,6 +1547,14 @@ Describe 'Integrated Command Functions'
The error should equal 'Unexpected DECISION value "invalid"'
End
+ It 'includes overwriting a file using do_encrypt'
+ OVERWRITE=no
+ When run do_encrypt 'y.txt'
+ The status should equal 1
+ The output should be blank
+ The error should equal 'Refusing to overwite y.txt'
+ End
+
It 'includes invalid values of SHOW in do_show'
SHOW='invalid'
When run do_show
@@ -1558,5 +1566,22 @@ Describe 'Integrated Command Functions'
}
The error should equal 'Unexpected SHOW value "invalid"'
End
+
+ It 'includes interactive yesno'
+ # Technically not unreachable, but not worse than faking a terminal
+ # for each call of `yesno` when the whole test suite is outside
+ # of terminal anyway
+
+ stty() { true; }
+ Data
+ #|x
+ #|Y
+ End
+ When call yesno 'Prompt?'
+ The status should be success
+ The error should be blank
+ The output should equal 'Prompt? [y/n]'
+ The variable ANSWER should equal 'y'
+ End
End
End