Skip to content

Commit 05b1675

Browse files
committed
Test signal exit code scenario.
1 parent 2fac8e4 commit 05b1675

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/support/acceptance_test.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,16 @@ class MyEngine < Rails::Engine
740740

741741
assert_failure app.spring_test_command, stderr: "omg (RuntimeError)"
742742
end
743+
744+
test "passes exit code from exit and signal" do
745+
artifacts = app.run("bin/rails runner 'Process.exit(7)'")
746+
code = artifacts[:status].exitstatus || artifacts[:status].termsig
747+
assert_equal 7, code, "Expected exit status to be 7, but was #{code}"
748+
749+
artifacts = app.run("bin/rails runner 'system(\"kill -7 \#{Process.pid}\")'")
750+
code = artifacts[:status].exitstatus || artifacts[:status].termsig
751+
assert_equal 7, code, "Expected exit status to be 7, but was #{code}"
752+
end
743753
end
744754
end
745755
end

0 commit comments

Comments
 (0)