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

Bundler

When you’re using Bundler to manage your dependencies, there are a few different ways you can ensure that the correct versions of all your libraries get loaded:

  • Call Bundler.require from your Ruby code
  • Wrap every Ruby program with bundle exec at the command line
  • Use Bundler’s stand-alone mode

All of these techniques work with RSpec. Let’s take a look at each one in turn.

The first option, Bundler.require, is convenient: it loads all your project’s gems, so you don’t have to remember to require each gem individually before use. But it has implications for your application’s boot time and maintainability, as Myron points out in his blog post.[123]

The second option, bundle exec, is faster and avoids some of these maintainability pitfalls, ...

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