pashage

Yet Another Opinionated Re-engineering of the Unix Password Store
git clone https://git.instinctive.eu/pashage.git
Log | Files | Refs | README | LICENSE

commit 0280dc8e786ee3e467b64b101241c3a12fb7184a
parent 8cc504d4edef9f2c91ff68ab3d5c078f341b3a87
Author: Natasha Kerensikova <natgh@instinctive.eu>
Date:   Sun, 27 Oct 2024 10:28:34 +0000

Pass-like handling of empty argument list is tested
Diffstat:
Mspec/pass_spec.sh | 109+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 109 insertions(+), 0 deletions(-)

diff --git a/spec/pass_spec.sh b/spec/pass_spec.sh @@ -487,6 +487,18 @@ Describe 'Pass-like command' The contents of file "${GITLOG}" should equal "$(setup_log)" End + It 'displays usage when called without argument' + Skip if 'pass(age) needs bash' check_skip $2 + Skip if 'passage has no init' [ "$2" = passage ] + When run script $1 init + The status should equal 1 + The output should be blank + The error should include 'Usage:' + The error should include ' init ' + The result of function git_log should be successful + The contents of file "${GITLOG}" should equal "$(setup_log)" + End + It 'rejects a path containing ..' Skip if 'pass(age) needs bash' check_skip $2 Skip if 'passage has no init' [ "$2" = passage ] @@ -623,6 +635,17 @@ Describe 'Pass-like command' The line 1 of output should match pattern 'Search *: z' The error should be blank End + + It 'displays usage when called without argument' + Skip if 'pass(age) needs bash' check_skip $2 + When run script $1 find + The status should equal 1 + The output should be blank + The error should include 'Usage:' + The error should include ' find ' + The result of function git_log should be successful + The contents of file "${GITLOG}" should equal "$(setup_log)" + End End Describe 'show' @@ -778,6 +801,17 @@ Describe 'Pass-like command' The status should be success The output should be blank End + + It 'displays usage when called without argument' + Skip if 'pass(age) needs bash' check_skip $2 + When run script $1 grep + The status should equal 1 + The output should be blank + The error should include 'Usage:' + The error should include ' grep ' + The result of function git_log should be successful + The contents of file "${GITLOG}" should equal "$(setup_log)" + End End Describe 'insert' @@ -935,6 +969,17 @@ Describe 'Pass-like command' The contents of file "${GITLOG}" should equal "$(expected_log $3)" End + It 'displays usage when called without argument' + Skip if 'pass(age) needs bash' check_skip $2 + When run script $1 insert + The status should equal 1 + The output should be blank + The error should include 'Usage:' + The error should include ' insert ' + The result of function git_log should be successful + The contents of file "${GITLOG}" should equal "$(setup_log)" + End + It 'rejects a path containing ..' Skip if 'pass(age) needs bash' check_skip $2 When run script $1 insert -e fluff/../new-secret @@ -1204,6 +1249,17 @@ Describe 'Pass-like command' The contents of file "${GITLOG}" should equal "$(setup_log)" End + It 'displays usage when called without argument' + Skip if 'pass(age) needs bash' check_skip $2 + When run script $1 edit + The status should equal 1 + The output should be blank + The error should include 'Usage:' + The error should include ' edit ' + The result of function git_log should be successful + The contents of file "${GITLOG}" should equal "$(setup_log)" + End + It 'rejects a path containing ..' Skip if 'pass(age) needs bash' check_skip $2 EDITOR=true @@ -1414,6 +1470,17 @@ Describe 'Pass-like command' The contents of file "${GITLOG}" should equal "$(expected_log $3)" End + It 'displays usage when called without argument' + Skip if 'pass(age) needs bash' check_skip $2 + When run script $1 generate + The status should equal 1 + The output should be blank + The error should include 'Usage:' + The error should include ' generate ' + The result of function git_log should be successful + The contents of file "${GITLOG}" should equal "$(setup_log)" + End + It 'rejects a path containing ..' Skip if 'pass(age) needs bash' check_skip $2 When run script $1 generate subdir/../new-secret @@ -1595,6 +1662,17 @@ Describe 'Pass-like command' The contents of file "${GITLOG}" should equal "$(setup_log)" End + It 'displays usage when called without argument' + Skip if 'pass(age) needs bash' check_skip $2 + When run script $1 delete + The status should equal 1 + The output should be blank + The error should include 'Usage:' + The error should include ' delete ' + The result of function git_log should be successful + The contents of file "${GITLOG}" should equal "$(setup_log)" + End + It 'rejects a path containing ..' Skip if 'pass(age) needs bash' check_skip $2 When run script $1 delete subdir/../fluff/one @@ -1975,6 +2053,16 @@ Describe 'Pass-like command' The contents of file "${GITLOG}" should equal "$(setup_log)" End + It 'displays usage when called without argument' + Skip if 'pass(age) needs bash' check_skip $2 + When run script $1 mv + The status should equal 1 + The output should be blank + The error should include 'Usage:' + The result of function git_log should be successful + The contents of file "${GITLOG}" should equal "$(setup_log)" + End + It 'fails to rename a non-existent directory' Skip if 'pass(age) considers "stale/" as the file "stale"' \ [ ! $2 = pashage ] @@ -2384,6 +2472,17 @@ Describe 'Pass-like command' The contents of file "${GITLOG}" should equal "$(expected_log $3 $2)" End + It 'displays usage when called without argument' + Skip if 'pass(age) needs bash' check_skip $2 + When run script $1 copy + The status should equal 1 + The output should be blank + The error should include 'Usage:' + The error should include ' copy ' + The result of function git_log should be successful + The contents of file "${GITLOG}" should equal "$(setup_log)" + End + It 'fails to copy a non-existent directory' Skip if 'pass(age) considers "stale/" as the file "stale"' \ [ ! $2 = pashage ] @@ -2429,6 +2528,16 @@ Describe 'Pass-like command' The output should equal "$(setup_log)" End + It 'displays git usage when called without argument' + Skip if 'pass(age) needs bash' check_skip $2 + When run script $1 git + # The status is success for pass(age) but 1 (from git) for pashage + The output should include 'usage: git' + The error should be blank + The result of function git_log should be successful + The contents of file "${GITLOG}" should equal "$(setup_log)" + End + remove_git() { rm -rf "${PREFIX}/.git"; } BeforeEach remove_git