Add tests for every command
This commit is contained in:
25
tests/redis_info.bats
Executable file
25
tests/redis_info.bats
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bats
|
||||
load test_helper
|
||||
|
||||
setup() {
|
||||
dokku "$PLUGIN_COMMAND_PREFIX:create" l >&2
|
||||
}
|
||||
|
||||
teardown() {
|
||||
dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" l >&2
|
||||
}
|
||||
|
||||
@test "($PLUGIN_COMMAND_PREFIX:info) error when there are no arguments" {
|
||||
run dokku "$PLUGIN_COMMAND_PREFIX:info"
|
||||
assert_contains "${lines[*]}" "Please specify a name for the service"
|
||||
}
|
||||
|
||||
@test "($PLUGIN_COMMAND_PREFIX:info) error when service does not exist" {
|
||||
run dokku "$PLUGIN_COMMAND_PREFIX:info" not_existing_service
|
||||
assert_contains "${lines[*]}" "Redis service not_existing_service does not exist"
|
||||
}
|
||||
|
||||
@test "($PLUGIN_COMMAND_PREFIX:info) success" {
|
||||
run dokku "$PLUGIN_COMMAND_PREFIX:info" l
|
||||
assert_contains "${lines[*]}" "DSN: redis://172.17.0.34:6379/0"
|
||||
}
|
||||
Reference in New Issue
Block a user