I'm currently using Rspec for testing, along with Guard and Spork for convenience. I've noticed that unless I quit and restart Guard, the random seed does not change between runs. While this is not a major issue, it would be handy if it did.
Anyone know of a way to change things so that it does use a new seed each time it runs the tests??
I added the --order rand:$RANDOM
flag to my Guardfile:
guard 'rspec', zeus: true, cli: '--color --order rand:$RANDOM' do
watch(...)
end
Yes, the following works for me. Add to spec_helper.rb:
Spork.each_run do
RSpec.configuration.seed = srand && srand % 0xFFFF
end
From here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With