You did not specify the source of your specification, so itβs hard to say where the problem is, but in general you can use the -e option to run one example. Given this specification:
# spec/models/user_spec.rb require 'spec_helper' describe User do it "is true" do true.should be_true end describe "validation" do it "is also true" do true.should be_true end end end
This command line:
rspec spec/models/user_spec.rb -e "User is true"
Will produce this result:
Run filtered including {:full_description=>/(?-mix:User\ is\ true)/} . Finished in 0.2088 seconds 1 example, 0 failures
And if you want to call another example, one that is nested in a validation group, you should use this:
rspec spec/models/user_spec.rb -e "User validation is also true"
Or to run all the examples in a validation group:
rspec spec/models/user_spec.rb -e "User validation"
source share