Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix test which prevents connection reset on failing and remove hardco…

…ded connection

[#4689 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information...
commit 1ac00a6844d7f22af3f19c9f1e0dde9ebda8b5a4 1 parent e4accde
@MasterLambaster MasterLambaster authored jeremy committed
Showing with 7 additions and 8 deletions.
  1. +7 −8 activerecord/test/cases/adapter_test.rb
View
15 activerecord/test/cases/adapter_test.rb
@@ -65,15 +65,14 @@ def test_show_nonexistent_variable_returns_nil
end
def test_not_specifying_database_name_for_cross_database_selects
- assert_nothing_raised do
- ActiveRecord::Base.establish_connection({
- :adapter => 'mysql',
- :username => 'rails'
- })
- ActiveRecord::Base.connection.execute "SELECT activerecord_unittest.pirates.*, activerecord_unittest2.courses.* FROM activerecord_unittest.pirates, activerecord_unittest2.courses"
+ begin
+ assert_nothing_raised do
+ ActiveRecord::Base.establish_connection(ActiveRecord::Base.configurations['arunit'].except(:database))
+ ActiveRecord::Base.connection.execute "SELECT activerecord_unittest.pirates.*, activerecord_unittest2.courses.* FROM activerecord_unittest.pirates, activerecord_unittest2.courses"
+ end
+ ensure
+ ActiveRecord::Base.establish_connection 'arunit'
end
-
- ActiveRecord::Base.establish_connection 'arunit'
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.