Reputation: 31
Is there any existing solution (a gem preferably) to run some slices of specs with rspec?
for example:
rspec . # runs whole test suite
rspec . --keywords=project # runs all specs that have "project" keyword there somewhere
or something similar?
Upvotes: 3
Views: 2499
Reputation: 8192
I think the built-in "--example" option does what you want:
rspec . --example "project"
Upvotes: 4
Reputation: 449
You can use tags in rspec by supplying a key-value pair to a describe, context or test, like so:
describe "A set of tests", :constraint => 'slow'
describe "Another set of tests", :focus => true
You could run either of these sets by doing:
rspec --tag constraint:slow
rspec --tag focus
Upvotes: 9