When I run rspec w/o Spork its's exit code behaves as expected (0 - passed, 1 - failed, and honor --failure-exit-code), but when I run tests using Spork it always exits with code 1.
It looks like the cause of the problem is in RSpec::Core::DRbCommandLine.run() which always returns result of spec_server.run(@options.drb_argv, err, out) which is IO and it looks like it is converted to 1 :(
I tested this extensively when trying to reproduce this issue: #640
If you can provide a failing test case, please report back here and I'll re-open. Thanks.
describe "simple rspec test" do
it "should just pass" do
I use ruby 1.8.7p358 on Windows (it is important, since on linux rspec does return 0)
rspec --drb spec
Finished in 0.008 seconds
1 example, 0 failures
<-- Slave(1) run done!
Let me know if you need more information.
@os97673, are you able to take a stab at fixing this? I have no Windows development environment that I can use; like you said, I can't reproduce it in Linux.
well, I think I can try :)
Any news, @os97673?
sorry for delay, all "back to school" activities eat almost all my free time recently.
Finally I've got some time to investigate the problem.
It looks like the cause of the problem is in Spork. On Windows (and for JRuby) it uses Spork::RunStrategy::Magazine strategy while on Linux Spork::RunStrategy::Forking is used. And the actual result is lost somewhere between Magazine and MagazineSlave. Also, during investigation I've noticed that this strategy doesn't work with ruby 1.9.3.
Thus I'd say there is nothing rspec can fix itself, but Spork should be fixed instead (feel free to close the ticket).
I'm going to file ticket about the problem against Spork and will add link to it here.
I've filed sporkrb/spork#210 about this problem.
Thanks so much @os97673. I'll close this issue and follow the sporkrb one.