GMA
GMA

Reputation: 6096

Rspec: Skipping an exclusion filter

I have some slow RSpec tests that I've tagged with :slow. I've set RSpec up to skip them default by adding the line config.filter_run_excluding slow: true to my RSpec configuration. And I can run the slow tests by running rspec --tag slow.

But how can I run all the tests using one command, including slow and non-slow tests? I can't figure it out from the docs.

Upvotes: 0

Views: 326

Answers (1)

Yann VERY
Yann VERY

Reputation: 1819

You can find a similar question here : Command line to run all examples in RSpec, including ones that are filtered out?

In few words, this feature doesn't exist on rspec but you can use env variable :

RSpec.configure do |c|
  c.filter_run_excluding slow: true unless ENV['ALL']
end

Call ALL=1 rspec will run all the specs including the slow tag.

Upvotes: 2

Related Questions