-
Notifications
You must be signed in to change notification settings - Fork 21
create tests/config.bats (fixes #2119)
#2121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| #!/usr/bin/env bats | ||
| load test-helper | ||
|
|
||
| @test "$clinom config" { | ||
| skip "Run $clinom config with the [update|add|delete|clear] subcommands" | ||
| run "${clicmd}" config | ||
| [ "$status" -eq 0 ] | ||
| } | ||
|
|
||
| @test "$clinom config update" { | ||
| run "${clicmd}" config update abc 123 | ||
| if [[ "$output" == *"Error"* ]]; then | ||
| skip "Missing varname or varvalue" | ||
| fi | ||
|
||
| assert_success | ||
| } | ||
|
|
||
| @test "$clinom config add" { | ||
| run "${clicmd}" config add abc 123 | ||
| if [[ "$output" == *"Error"* ]]; then | ||
| skip "Missing varname or varvalue" | ||
| fi | ||
|
||
| assert_success | ||
| } | ||
|
|
||
| @test "$clinom config delete" { | ||
| run "${clicmd}" config delete abc | ||
| if [[ "$output" == *"Error"* ]]; then | ||
| skip "Missing varname" | ||
| fi | ||
|
||
| assert_success | ||
| } | ||
|
|
||
| @test "$clinom config delete (non-existent user)" { | ||
| run "${clicmd}" config clear | ||
| run "${clicmd}" config delete abc | ||
| if [[ "$output" == *"Error"* ]]; then | ||
| skip "Can't delete a non-existent user" | ||
| fi | ||
|
||
| assert_success | ||
| } | ||
|
|
||
| @test "$clinom config clear" { | ||
| run "${clicmd}" config clear | ||
| assert_success | ||
JLKwong marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test could check for the 2 possible outputs of
treehouses config: