views:

87

answers:

1

With RSpec and Cucumber, why is it preferred to specify :lib => false in the environment files - and then explicitly require the gems in spec_helper.rb and env.rb?

+1  A: 

The newest spec_helper.rb doesn't explicitly require them. Make sure you upgrade to the newest gems.

This is from The RSpec Book.

We use lib => false for rspec and rspec-rails because even though we may want rails’ gem configuration to help us with installing and bundling gems, we want rspec-rails’ rake tasks to control when they are loaded.

Basically you want Rails and all of the gem rake tasks to still work, but you want RSpec to handle when they are loaded to make sure you aren't including things more than once.

Hope this helps! Happy testing!

Kent

ewakened