diff --git a/package.json b/package.json index 9be1d3578e..20f1713e8c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@treehouses/cli", - "version": "1.25.35", + "version": "1.25.36", "remote": "4000", "description": "Thin command-line interface for Raspberry Pi low level configuration.", "main": "cli.sh", diff --git a/tests/message/slack.bats b/tests/message/slack.bats new file mode 100755 index 0000000000..38dbb5e2be --- /dev/null +++ b/tests/message/slack.bats @@ -0,0 +1,34 @@ +#!/usr/bin/env bats +load ../test-helper + +@test "$clinom message slack apitoken" { + run "${clicmd}" message slack apitoken + assert_success +} + +@test "$clinom message slack apitoken (create invalid token)" { + run "${clicmd}" message slack apitoken fake-token + assert_output --partial 'invalid token' +} + +@test "$clinom message slack apitoken (no token)" { + run "${clicmd}" message slack apitoken + assert_output --partial 'api.slack.com/apps' +} + +@test "$clinom message slack apitoken (create token)" { + run "${clicmd}" message slack apitoken xoxp-fake-token + assert_output --partial 'Your slack apitoken' +} + +@test "$clinom message slack apitoken (overrite token)" { + run "${clicmd}" message slack apitoken xoxp-fake-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 xoxp-fake-token + run "${clicmd}" message slack apitoken + assert_output --partial 'Your API access token is' +}