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.

Categories

Leave a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About this Entry

This page contains a single entry by Mike Tsao published on June 29, 2011 2:03 PM.

Mission. F*cking. Accomplished. was the previous entry in this blog.

TQW is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 4.2-en