[rspec-users] [RSpec] Setting a gem dep on rspec-rails

Nick Hoffman nick at deadorange.com
Mon Feb 9 09:34:26 EST 2009


On 08/02/2009, at 4:39 PM, Matt Wynne wrote:
> 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>  
>>> wrote:
>>>> 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 it
>>> 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.
>
>
> Matt Wynne

I've decided to just freeze the rspec and rspec-rails gems into vendor/ 
gems/ . It makes life easy when moving the app between hosts, and  
means that I don't have to worry about config.gem shenanigans.

Thanks for all of your suggestions, guys. Much appreciated!



More information about the rspec-users mailing list