Repository navigation
Set RAILS_ENV to test for test tasks - #441
etiennebarrie wants to merge 1 commit into
Conversation
Rails had a hack that was removed in 7.0, this adds it back here.
|
@etiennebarrie Do you have any more context on why this hack was removed from Rails 7? How does Rails currently handle switching environments for rake tasks? |
|
I removed it because I felt like it was bad form to change the environment when requiring a file and it wasn't necessary anymore since we were now using TestUnit::Runner (i.e. Also it was causing issues using Rails engines, which load all the dummy app's tasks under
There's no longer any specific code related to the environment for rake tasks as far as I know. If you happen to run one of the test tasks, they fork to |
|
Fixed this in #470.
Yeah, good call. I refactored this to not mutate the environment, but just return a different value internally for dotenv. |
Rails had a hack that was removed in 7.0, this adds it back here.