๐ฟ What? ยง
- ๐ฑ If you want to run rspec for a specific example, context or describe without having to care about path file, line number, you can try it:
# spec/rails_helper.rb
RSpec.configure do |config|
config.filter_run_when_matching focus: true
end
- ๐ฑ Then you add f to example, context or describe, Rspec will only focus it.
#example
fit 'should tell height' do
expect(@person.height).to eq(160)
end
# as well
it 'should tell height', focus: true do
expect(@person.height).to eq(160)
end
- ๐ฑ You can add focus for multi examples
๐ฟ Refer ยง
https://manny.codes/7-ways-to-selectively-run-rspec-tests/