Add tests for every implemented command

This commit is contained in:
Loïc Guitaut
2015-09-10 14:21:27 +02:00
parent c1fc398997
commit 547653b27e
21 changed files with 456 additions and 32 deletions

26
tests/service_restart.bats Executable file
View File

@@ -0,0 +1,26 @@
#!/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:restart) error when there are no arguments" {
run dokku "$PLUGIN_COMMAND_PREFIX:restart"
assert_contains "${lines[*]}" "Please specify a name for the service"
}
@test "($PLUGIN_COMMAND_PREFIX:restart) error when service does not exist" {
run dokku "$PLUGIN_COMMAND_PREFIX:restart" not_existing_service
assert_contains "${lines[*]}" "service not_existing_service does not exist"
}
@test "($PLUGIN_COMMAND_PREFIX:restart) success" {
run dokku "$PLUGIN_COMMAND_PREFIX:restart" l
assert_success
}