everydayrails / everydayrails-rspec-2017

Sample source for the 2017 edition of Everyday Rails Testing with RSpec.
http://rspectutorial.com
312 stars 247 forks source link

Chapter 9, filter_run_when_matching would be better #122

Open JunichiIto opened 2 years ago

JunichiIto commented 2 years ago

In page 158, chapter 9, you write the code below:

RSpec.configure.do |config|
  config.filter_run focus: true
  config.run_all_when_everything_filtered = true 
end

Since RSpec 3.5, you can write like this:

RSpec.configure.do |config|
  config.filter_run_when_matching :focus
end

See also: https://github.com/rspec/rspec-core/blob/main/Changelog.md#350beta3--2016-04-02