On Mon, Aug 10, 2009 at 4:39 AM, Balint Erdi<balint.e...@gmail.com> wrote:
>
>
>
>>
>> > Rails::Initializer.run do |config|
>> >  (...)
>> >  config.gem "rspec", :version => ">= 1.2.8", :lib => 'spec'
>> >  config.gem "rspec-rails", :version => ">= 1.2.7.1", :lib => 'spec/
>>
>> Use lib => false to keep rails from automatically loading rspec and/or
>> rspec-rails
>>
>> This should also be in config/environments/test.rb
>>
>> HTH,
>> David
>>
>
> Ok, I now have the following lines in my environment.rb:
>
>  config.gem "rspec", :version => ">= 1.2.6", :lib => false
>  config.gem "rspec-rails", :version => ">= 1.2.6", :lib => false
>
> And these in my environments/test.rb:
>
>  config.gem "rspec", :lib => 'spec'
>  config.gem "rspec-rails", :lib => 'spec/rails'
>
> Indeed, that solves the original problem of forcing the test
> environment when running the server. I refrained from specifying the
> version in the test.rb file since that would be a violation of DRY. I
> am not 100% satisfied since I still have to define the gems in two
> places, but this is now a minor issue and I don't see an easy way to
> fix it.

Why are you duplicating it in environment.rb? You shouldn't have to
have it in both places. In all of my rails apps I _only_ have it in
environments/test.rb:

config.gem "rspec", :version => ">= 1.2.8", :lib => false
config.gem "rspec-rails", :version => ">= 1.2.7.1", :lib => false


>
> Thank you for your help, David.
> Bálint
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to