From 558382ba97fb577a651e15221599264fa5fb0947 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 21 Feb 2023 00:08:53 -0500 Subject: [PATCH] tests: add output/status and flesh out restart tests a bit more --- tests/service_link.bats | 10 +++++++++- tests/service_unlink.bats | 13 +++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/tests/service_link.bats b/tests/service_link.bats index 7db60eb..109bf75 100755 --- a/tests/service_link.bats +++ b/tests/service_link.bats @@ -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 } diff --git a/tests/service_unlink.bats b/tests/service_unlink.bats index c906455..fde385f 100755 --- a/tests/service_unlink.bats +++ b/tests/service_unlink.bats @@ -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 }