[rspec-users] return code question

Ben Fyvie ben.fyvie at champsoftware.com
Tue Aug 12 14:22:40 EDT 2008

We are trying to automate the running of our rspec tests for our Rails app
on a build server using Capistrano.  The problem is that Capistrano seems to
think that the command called to run the model tests failed when in fact I
believe it succeeded. I believe the problem has to do with the return code
from the command I am running.. The command I am running is:

ruby script/spec spec/models -f html:model_test_results.html
The output file seems to be complete as it has both the opening and closing
html tags and it has the results of all of our tests. But when I run $? To
get the return code of the last command it says it was "1" which I believe
signifies that the command was not successful and is what is causing our
Capistrano task to abort.  We are using RSpec 1.1.4 and in case you're
curious the output from Capistrano looks like this:


  * executing "cd /data/nightingalenotes/releases/20080812160703 && ruby
spec spec/models -f html:public/rspec_test_results/model_test_results.html"
    servers: ["buildnexus.champ.net"]
    [buildnexus.champ.net] executing command
    command finished
*** [deploy:update_code] rolling back
  * executing "rm -rf /data/nightingalenotes/releases/20080812160703; true"
    servers: ["buildnexus.champ.net"]
    [buildnexus.champ.net] executing command
    command finished
command "cd /data/nightingalenotes/releases/20080812160703 && ruby
script/spec s
pec/models -f html:public/rspec_test_results/model_test_results.html" failed





Ben Fyvie


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20080812/990e1610/attachment.html>

More information about the rspec-users mailing list