[rspec-users] Return code for running stories
rspec-users at kero.tmfweb.nl
Fri May 2 15:57:22 EDT 2008
Just wrote a few stories and committed code to a project of mine,
then realized I made a mistake (with the commit, not the code or
tests). It would be nice to put the script
that runs the stories as a pre-commit hook, preventing the commit
from succeeding if the stories fail.
For that, I need to set the right exit code.
In turn, I need to know he result of the tests.
Given the prescription of running stories:
with_steps_for :accounts do
I see neither #with_steps_for, nor #run return anything resembling
the result of the tests (which does not really surprise me).
So how to get the success/pending/failure of the stories out?
Should I write a formatter/listener that exit(1)s on failure?
PS: I'm back after a few months, and -behold- it looks like I
can use rspec for work, too :)
More information about the rspec-users