Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

rake spec not loading RAILS_ENV=test #7227

Closed
krsmurata opened this Issue · 3 comments

2 participants

@krsmurata

First, I don't know if it's a Rails issue or an RSpec problem, I'm posting here because I found the commit on Rails that introduced this new behavior or bug.

I'm used to just run: rake or rake spec to run the tests, running every time the tasks necessary for the test environment.

But, right now, with Rails 3.2.7 when running rake spec it doesn't set the RAILS_ENV to test, throwing some errors because it doesn't include the necessary list for the test env.

So, we have to either set the RAILS_ENV explicit to "test" before rake spec or use rspec spec/ and run db:prepare manually.

The commit I mentioned that introduced this was: caironoleto@f8df3f3

Environment:

Rails 3.2.7
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.4.0]

@carlosantoniodasilva

Thanks for reporting.

This has already been reported in #7175 and solved in the 3-2-stable branch. When 3.2.8 comes out (soon I believe), it's going to be working fine, meanwhile you can either not use rake spec (use rspec), change ENV["RAILS_ENV"] ||= "test" to ENV["RAILS_ENV"] = "test" in your spec_helper, go back to 3.2.6 or bundle from 3-2-stable branch (or always set RAILS_ENV as you mentioned).

@krsmurata

Sorry for that, I didn't find it because it was closed.

Thanks @carlosantoniodasilva :)

@carlosantoniodasilva

No problem! :)

@jasonmp85 jasonmp85 referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@jasonmp85 jasonmp85 referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@jasonmp85 jasonmp85 referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.