How to run a single RSpec test?

后端 未结 17 778

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:17

    Usually I do:

    rspec ./spec/controllers/groups_controller_spec.rb:42
    

    Where 42 represents the line of the test I want to run.

    EDIT1:

    You could also use tags. See here.

    EDIT 2:

    Try:

    bundle exec rspec ./spec/controllers/groups_controller_spec.rb:42
    

提交回复
热议问题