-
-
Notifications
You must be signed in to change notification settings - Fork 1k
RSpec not setting environment to test #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is only w/ 1.9.2? |
I've just tested with 1.8.7-p248 and the problem is still there |
I've just changed |
I can't duplicate this in a fresh app or any of the apps I'm running using 'rspec' or 'rake spec'. I don't want to force it to 'test' because that ties everybody's hands. I'm going to close this, but if you can find a way for me to reproduce it, please comment on this ticket and I'll reopen it. |
This is a solution to tests running in development environment as stated in issues rspec#70 and rspec#586. Before Rails 3.2.7 ENV['RAILS_ENV'] ||= 'test' ran tests without issues in test env as discussed in rails/rails#7175 (comment).
Similar to https://github.com/NYPL/mms/commit/d52745c43c88fd1979e23662d52a39ee71e03a9a The fact that RSpec uses ||= is because they don't want to 'force' people to use the 'test' Rails.env (source: rspec/rspec-rails#70 (comment)) I am happy to force us to use Rails.env `test`
I'm trying Rspec-2.0.0.beta.10 with Rails-3.0.0.beta3 and Ruby-1.9.2-preview3 and my environment is not getting set to 'test' as it should. I tryed using the spec command, rake spec and autotest but both Rails.env and ENV['RAILS_ENV'] are always 'development'.
At first I thought it was an Mongoid issue, but I created a new project using ActiveRecord and sqlite3 and the problem still exists.
The text was updated successfully, but these errors were encountered: