diff --git a/test/cli/app_test.rb b/test/cli/app_test.rb index 28e7fbb0..b17ba8d4 100644 --- a/test/cli/app_test.rb +++ b/test/cli/app_test.rb @@ -47,6 +47,19 @@ class CliAppTest < CliTestCase end end + test "exec" do + run_command("exec", "ruby -v").tap do |output| + assert_match /ruby -v/, output + end + end + + test "exec with reuse" do + run_command("exec", "--reuse", "ruby -v").tap do |output| + assert_match %r[docker ps --filter label=service=app --format \"{{.Names}}\" | sed 's/-/\\n/g' | tail -n 1], output # Get current version + assert_match %r[docker exec app-999 ruby -v], output # Get current version + end + end + private def run_command(*command) stdouted { Mrsk::Cli::App.start([*command, "-c", "test/fixtures/deploy_with_accessories.yml"]) }