O'Reilly logo

Effective Testing with RSpec 3 by Myron Marston, Ian Dees

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using rspec-rails

Once rspec-rails is installed, you’ll be able to run your spec suite using either bundle exec rspec or bin/rake spec. Commands in the bin directory, like rake or rails, are Rails-generated binstubs (wrapper scripts) that save you the hassle of remembering to type bundle exec before every command.[127]

If you’re used to creating binstubs via Bundler’s --binstubs option as described in Bundler, be aware that this option may not play nicely with Spring, a Rails preloader designed to speed up boot times.[128] You may see Rails commands hang or print warning messages from the Bundler-generated binstubs. To solve the problem, you’ll need to either remove Spring or switch to the binstubs provided by Rails:

 $ ​​bundle config --delete ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required