On Sep 8, 3:44 pm, Frederick Cheung <[email protected]>
wrote:
> On 8 Sep 2009, at 14:01, Marnen Laibow-Koser wrote:
>
>
>
> > Piero Di Bello wrote:
> >> Hi
> >> How can I have the tests for my Rails app to be executed in a random
> >> order?
>
> > At least with RSpec, specs are executed in unpredictable order.  I  
> > think
> > it's the same each time, but it's not the order in which they appear  
> > in
> > the spec file.
>
> > But why do you need this anyway? Each test should start from a clean
> > slate, so the order should be completely immaterial.
>
> Should, but it is possible for this not to be true. A random order  
> would be hard to work with though - Run your suite and a test fails,  
> run it again and it doesn't any more.

The whole point of randomizing test execution is to have a better
chance to discover that the tests are not independent.  Once you find
a test that fails because of the order of execution, you fix it so
that it does not happen anymore.

Matteo

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to