foreman run should exit with the same code as its command

This commit is contained in:
Omar Khan
2012-08-24 16:50:05 +01:00
parent 68f098c1d2
commit 574e852710
3 changed files with 12 additions and 0 deletions
+6
View File
@@ -58,6 +58,12 @@ def fork_and_capture(&blk)
end
end
def fork_and_get_exitstatus(args)
pid = Process.spawn("bundle exec bin/foreman #{args}", :out => "/dev/null", :err => "/dev/null")
Process.wait(pid)
$?.exitstatus
end
def mock_exit(&block)
block.should raise_error(SystemExit)
end