This disables the loading of the spring gem in bin/spring when spring id disabled.
This code fix addresses a bug that occurs under the following circumstances:
A rails project has spring installed for developers as a development depencency
The automated tests are run in a test container that has the test dependencies, but not the development depencencies
The tests contain this recommend block from Active Record
# Checks for pending migrations and applies them before tests are run.
# If you are not using ActiveRecord, you can remove these lines.
begin
ActiveRecord::Migration.maintain_test_schema!
rescue ActiveRecord::PendingMigrationError => exception
puts exception.to_s.strip
exit 1
end
This disables the loading of the spring gem in
bin/spring
when spring id disabled.This code fix addresses a bug that occurs under the following circumstances:
system("bin/rails db:test:prepare")
bin/rails
call runs bin/springbin/spring
attempts to load the spring gem which failsWith the additional check for
SPRING_DISABLED
env variable, rails tests do not attempt to load spring when the env variable is set.