How to replace Rspec's ENV[“RAILS_ENV”] ||= 'test' deprecated in Rails 3.0?
-
12-11-2019 - |
Question
I'm using rails (3.0.4)
and rspec-rails (2.5.0). When I run
rails generate rspec:install
it produces
spec_helper.rb` that contains this line:
ENV["RAILS_ENV"] ||= 'test'
When I run rake spec
I get this warning on in the terminal:
DEPRECATION WARNING: RAILS_ENV is deprecated. Please use ::Rails.env.
This isn't as annoying since that only runs once inside my Spork.prefork
, but I'd like to get past that deprecation if possible. I'm new to Rails and haven't found mention of this in the rspec-rails issues or anywhere else.
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow