Skip to content

Commit 43ed7f6

Browse files
zygzagZrafaelfranca
authored andcommitted
Test signal exit code scenario.
1 parent 6bedfad commit 43ed7f6

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
@@ -745,6 +745,16 @@ class MyEngine < Rails::Engine
745745

746746
assert_failure app.spring_test_command, stderr: "omg (RuntimeError)"
747747
end
748+
749+
test "passes exit code from exit and signal" do
750+
artifacts = app.run("bin/rails runner 'Process.exit(7)'")
751+
code = artifacts[:status].exitstatus || artifacts[:status].termsig
752+
assert_equal 7, code, "Expected exit status to be 7, but was #{code}"
753+
754+
artifacts = app.run("bin/rails runner 'system(\"kill -7 \#{Process.pid}\")'")
755+
code = artifacts[:status].exitstatus || artifacts[:status].termsig
756+
assert_equal 7, code, "Expected exit status to be 7, but was #{code}"
757+
end
748758
end
749759
end
750760
end

0 commit comments

Comments
 (0)