Last Updated: February 25, 2016
·
642
· xianpants

Run feature specs after all other specs

Want to see all of your fast specs finish before running slow feature specs? Try this:

# spec_helper.rb
RSpec.configure do |config|
  #...
   config.order_groups do |groups|
      features, others = groups.partition { |g|
        g.metadata[:type] == :feature
      }
      others.shuffle + features
    end

  # Be sure this it commented out...
  #config.order = "random"
end

1 Response
Add your response

I almost feel like this should be the default (or at least an option) in rspec itself. This is how I usually want to run my tests.

over 1 year ago ·