Skip to content

Commit

Permalink
tests: add output/status and flesh out restart tests a bit more
Browse files Browse the repository at this point in the history
  • Loading branch information
Jose Diaz-Gonzalez committed Feb 21, 2023
1 parent af0b0c2 commit 558382b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/service_link.bats
Original file line number Diff line number Diff line change
Expand Up @@ -114,18 +114,26 @@ teardown() {
dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app
}

@test "($PLUGIN_COMMAND_PREFIX:unlink) respects --no-restart" {
@test "($PLUGIN_COMMAND_PREFIX:link) respects --no-restart" {
run dokku "$PLUGIN_COMMAND_PREFIX:link" ls my-app --no-restart
echo "output: $output"
echo "status: $status"
assert_output_contains "Restarting app my-app" 1
assert_success

run dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app
echo "output: $output"
echo "status: $status"
assert_success

run dokku "$PLUGIN_COMMAND_PREFIX:link" ls my-app --no-restart
echo "output: $output"
echo "status: $status"
assert_output_contains "Restarting app my-app" 0
assert_success

run dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app
echo "output: $output"
echo "status: $status"
assert_success
}
13 changes: 13 additions & 0 deletions tests/service_unlink.bats
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,20 @@ teardown() {
}

@test "($PLUGIN_COMMAND_PREFIX:unlink) respects --no-restart" {
run dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app
echo "output: $output"
echo "status: $status"
assert_output_contains "Restarting app my-app" 1
assert_success

run dokku "$PLUGIN_COMMAND_PREFIX:link" ls my-app
echo "output: $output"
echo "status: $status"
assert_success

run dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app --no-restart
echo "output: $output"
echo "status: $status"
assert_output_contains "Restarting app my-app" 0
assert_success
}

0 comments on commit 558382b

Please sign in to comment.