Execute a single RSpec file
A quickie for the Rails developers in the audience.
Step 1: At the top of your spec file, add #!/usr/bin/env ruby -S bundle exec rspec
Step 2: chmod +x spec/models/whatever_spec.rb
Now it's easy to run that one specfile that's giving you trouble, without remembering the command-line magic to run a single test. Works (with modifications) with Cucumber files, and probably TestUnit, too.

Leave a comment