rspec-style-guide icon indicating copy to clipboard operation
rspec-style-guide copied to clipboard

Recommend using random spec order

Open pirj opened this issue 5 years ago • 2 comments

It's strange that the guide is missing that.

pirj avatar Nov 23 '18 10:11 pirj

As a possible reference:

RSpec is capable of running your specs in :random order, and we generally recommend you do that.

Effective Testing with RSpec 3, Chapter 8

andyw8 avatar Apr 28 '19 18:04 andyw8

Alternatively, RSpec's spec_helper.rb template can also be used as a reference.

Run specs in random order to surface order dependencies. If you find an order dependency and want to debug it, you can fix the order by providing the seed, which is printed after each run.

pirj avatar Apr 29 '19 08:04 pirj