[rspec-users] rake spec order of running tests

David Chelimsky dchelimsky at gmail.com
Thu Aug 21 15:51:15 EDT 2008


On Thu, Aug 21, 2008 at 2:25 PM, Mark Wilden <mark at mwilden.com> wrote:
> We ran into a situation today where running 'rake spec' on one machine
> produced different results than when running on a different machine. My
> reasoned hunch is that the tests were run in a different order, due to the
> file-globbing producing differently ordered file lists. Because some tests
> used fixtures and some didn't, that resulted in different test db contents,
> depending on the order the tests were run (clearly, these tests need
> fixing).
>
> I haven't really looked into this at all, for now. But it occurs to me that
> if my suspicion is correct, this situation would be fixed by running tests
> in alphabetical order. Presumably this would be a change to the spec Rake
> task.
>
> Does this make any kind of sense? If so, I (or someone better suited to the
> task) could look into it further. (Coincidentally, a similar situation
> resulted in a contribution I made to Visual FoxPro!)

My personal feeling is that the code examples should be able to run in
any arbitrary order and still pass (no dependencies between examples),
so I would recommend you find the dependency rather than working
around the problem by enforcing order.

Cheers,
David

> ///ark
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list