Run focused specs
There are several options for running focused specs.
By appending the line number of it
, context
or describe
methods to the file name:
$ rspec spec/models/foo_spec.rb:10
By passing the line number to the -l
more than once:
$ rspec spec/models/foo_spec.rb -l 10 -l 40
Using your own tag
for describe
, context
and it
methods:
it "has a valid factory", focus: true do
expect(create :foo).to be_valid
end
$ rspec spec/models/foo_spec.rb -t focus
Run examples whose full nested names include string:
$ rspec spec/models/foo_spec -e when
Written by Vitaly
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Rspec
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#