[rspec-users] Running specs in reverse

Scott Taylor mailing_lists at railsnewbie.com
Sun Nov 11 16:50:17 EST 2007

On Nov 11, 2007, at 12:47 PM, David Chelimsky wrote:

> On Nov 11, 2007 11:01 AM, Alvin Schur <a.schur at nucleus.com> wrote:
>>> On Nov 08, 2007, at 6:07 pm, Alvin Schur wrote:
>>>> My goal is to detect inter-dependencies sooner than later...
>>> I have to say I've NEVER run specs backwards.  Am I sitting on a  
>>> time
>>> bomb?  Are there subtle traps that can create inter-dependencies
>>> between specs?  To look at my specs I would not assume that running
>>> order matters - I don't think I've ever used before(:all) for  
>>> example.
>>> Ashkey
>> Our team uses Test::Unit and numerous inter-dependencies have  
>> crept in.
>> Our team is also slowly moving to rspec.
>> Part of resolving the inter-dependencies is:
>> 1) education
>> 2) early detection
>> I don't want to be the "dependency police" particularly if rspec  
>> can do
>> the job automatically for everyone on the team.
> Well - I don't think rspec should do this implicitly - that might
> cause quite a bit of confusion for unsuspecting devs trying to debug.
> I command line arg like --toggle_reverse might work - but you'll have
> to submit a feature request in the tracker and probably a patch if you
> want to see it any time soon. Very low priority on my list.

I really like this idea, especially having had the following experience:

My coworker had no failing tests with rake spec, but I was having  
failing tests with Autotest.  He had introduced something into before 
(:all) which stored some data into the database.  Oddly enough - the  
tests weren't failing for him, although they were failing in reverse  
for me- showing a dependency between the specs.  The worst part is  
that he was convinced this was a non-problem (because they were  
passing for him).

I would implement this patch, if I had some good idea where I should  
store the state of the last test run (without adding an extra text  
file to my project).


More information about the rspec-users mailing list