29 lines
875 B
Bash
Executable File
29 lines
875 B
Bash
Executable File
#!/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:list) with no exposed ports" {
|
|
run dokku "$PLUGIN_COMMAND_PREFIX:list"
|
|
assert_contains "${lines[*]}" "l (running)"
|
|
}
|
|
|
|
@test "($PLUGIN_COMMAND_PREFIX:list) with exposed ports" {
|
|
dokku "$PLUGIN_COMMAND_PREFIX:expose" l 4242 4243 4244 4245
|
|
run dokku "$PLUGIN_COMMAND_PREFIX:list"
|
|
assert_contains "${lines[*]}" "l (running), exposed port(s): 27017->4242 27018->4243 27019->4244 28017->4245"
|
|
}
|
|
|
|
@test "($PLUGIN_COMMAND_PREFIX:list) when there are no services" {
|
|
dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" l >&2
|
|
run dokku "$PLUGIN_COMMAND_PREFIX:list"
|
|
assert_contains "${lines[*]}" "There are no MongoDB services"
|
|
dokku "$PLUGIN_COMMAND_PREFIX:create" l >&2
|
|
}
|