How to run a single RSpec test?

后端 未结 17 785

I have the following file:

/spec/controllers/groups_controller_spec.rb

What command in terminal do I use to run just that spec and in what

17条回答
  •  遥遥无期
    2020-12-04 05:11

    You can pass a regex to the spec command which will only run it blocks matching the name you supply.

    spec path/to/my_spec.rb -e "should be the correct answer"
    

    2019 Update: Rspec2 switched from the 'spec' command to the 'rspec' command.

提交回复
热议问题