[rspec-users] [RSpec] Setting a gem dep on rspec-rails
matt at mattwynne.net
Sun Feb 8 16:39:14 EST 2009
On 7 Feb 2009, at 19:02, David Chelimsky wrote:
> On Sat, Feb 7, 2009 at 12:27 PM, Pat Maddox <pergesu at gmail.com> wrote:
>> On Sat, Feb 7, 2009 at 9:30 AM, Nick Hoffman <nick at deadorange.com>
>>> With that said, I'm wondering what the accepted way to setup gem
>>> dependencies on rspec and rspec-rails is. Should one not bother?
>>> Should the
>>> "config.gem" lines go in config/environments/test.rb ?
>> I don't bother to use config.gem with rspec, but if you do then yes
>> should go in test.rb
> I don't either, but I'd like to get it working for ppl who want to
> do it.
> If anybody w/ config.gem fu wants to help, that'd be awesome.
I think this kinda works for us, but I had a couple of issues. One is
the problem with rake files, which will depend on RSpec being visible
to rake when it loads (which will ignore your vendor/gems folder). I
fixed that by putting the rake file in a huge begin / rescue / end
block so when the require 'spec' fails it doesn't load the rest of the
rake tasks. Ugly but functional.
The other issue was to do with a line in spec/rails which clobbers the
value of RAILS_ENV to be 'test' whatever it was previously set to. We
use an unconventional 'features' environment for running features
(means I can run cukes at the same time as specs) but this was going
hay-wire. I think David has put a patch for this into rspec-rails'
head but I don't know if it's made it's way into a gem yet.
So yeah, executive summary: What Pat said.
More information about the rspec-users