Skip to content

Commit

Permalink
revision (fixes #2110)
Browse files Browse the repository at this point in the history
  • Loading branch information
JLKwong committed Mar 22, 2021
1 parent c449bac commit 811752a
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions tests/message.bats
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,28 @@ load test-helper
assert_success
}

@test "$clinom message slack apitoken (create token)" {
run "${clicmd}" config delete slack_token
run "${clicmd}" message slack apitoken xoxp-fake-token
assert_output --partial 'Your slack apitoken'
}

@test "$clinom message slack apitoken (create invalid token)" {
run "${clicmd}" config delete slack_token
run "${clicmd}" config delete slack_apitoken
run "${clicmd}" message slack apitoken fake-token
assert_output --partial 'invalid token'
}

@test "$clinom message slack apitoken (no token)" {
run "${clicmd}" config delete slack_token
run "${clicmd}" message slack apitoken
assert_output --partial 'api.slack.com/apps'
}

@test "$clinom message slack apitoken (with token)" {
@test "$clinom message slack apitoken (create token)" {
run "${clicmd}" message slack apitoken xoxp-fake-token
run "${clicmd}" message slack apitoken
assert_output --partial 'Your API access token is'
assert_output --partial 'Your slack apitoken'
}

@test "$clinom message slack apitoken (after invalid token)" {
run "${clicmd}" config delete slack_token
run "${clicmd}" message slack apitoken fake-token
@test "$clinom message slack apitoken (overrite token)" {
run "${clicmd}" message slack apitoken xoxp-another-fake-token
assert_output --partial 'Your slack apitoken (xoxp-another-fake-token)'
}

@test "$clinom message slack apitoken (with token)" {
run "${clicmd}" message slack apitoken
assert_output --partial 'api.slack.com/apps'
assert_output --partial 'Your API access token is'
}

0 comments on commit 811752a

Please sign in to comment.