Test one specific file or spec with spring, without running guard

Public, Command Line, Shortcuts, Testing / TDD


Created: Mar 20, 2016     Updated: Mar 21, 2016

This syntax will allow you to take advantage of the speed that spring offers, when running just one spec file, or just one spec within the file (or context), without running guard.

To run one whole spec file (i.e. the spec/models/user_spec.rb file):

$ bundle exec spring rspec --color spec/models/user_spec.rb

To run one spec within a file, that begins on line 33:

$ bundle exec spring rspec --color spec/models/user_spec.rb:33