How to run a single RSpec test?

后端 未结 17 816

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

    Given you're on a rails 3 project with rspec 2, From the rails root directory:

      bundle exec rspec spec/controllers/groups_controller_spec.rb 
    

    should definitely work. i got tired of typing that so i created an alias to shorten 'bundle exec rspec' to 'bersp'

    'bundle exec' is so that it loads the exact gem environment specified in your gem file: http://gembundler.com/

    Rspec2 switched from the 'spec' command to the 'rspec' command.

提交回复
热议问题