Skip to content

Commit 34ddb57

Browse files
committed
Do not set back to previous config if there is no previous config
1 parent c555ecf commit 34ddb57

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/rake_test_support.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,11 @@ def teardown
100100
end
101101
Rake.application = @_prev_application
102102
restore_rails
103-
ActiveRecord::Base.configurations = @_prev_configurations
104-
ActiveRecord::Base.establish_connection @_prev_connection_config
103+
if @_prev_connection_config
104+
ActiveRecord::Base.configurations = @_prev_configurations
105+
ActiveRecord::Base.establish_connection @_prev_connection_config
106+
end
107+
105108
@rails_env_set = nil
106109
@full_env_loaded = nil
107110
raise error if error

0 commit comments

Comments
 (0)