Skip to content

Conversation

rjpadilla
Copy link
Member

No description provided.

@dogi dogi changed the title update tests/config.bats (fixes #2119) create tests/config.bats (fixes #2119) Mar 22, 2021
load test-helper

@test "$clinom config" {
skip "Run $clinom config with the [update|add|delete|clear] subcommands"
Copy link
Member

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:

Error: config file is empty; no variables to show

CONFIG_NAME=VARIABLE

Comment on lines 12 to 14
if [[ "$output" == *"Error"* ]]; then
skip "Missing varname or varvalue"
fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test could create a fake config variable like an apitoken for Gitter/Discord/Slack.

Comment on lines 20 to 22
if [[ "$output" == *"Error"* ]]; then
skip "Missing varname or varvalue"
fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test could create a fake config variable like an apitoken for Gitter/Discord/Slack.

Comment on lines 28 to 30
if [[ "$output" == *"Error"* ]]; then
skip "Missing varname"
fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test could create a fake config variable like an apitoken for Gitter/Discord/Slack.

Comment on lines 37 to 39
if [[ "$output" == *"Error"* ]]; then
skip "Can't delete a non-existent user"
fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test could assert_output --partial for the error output.

@rjpadilla rjpadilla requested a review from JLKwong March 31, 2021 21:40
Copy link
Member

@JLKwong JLKwong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thorough test. 😌👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants