Skip to content

Commit

Permalink
Fix test which prevents connection reset on failing and remove hardco…
Browse files Browse the repository at this point in the history
…ded connection

[#4689 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information
MasterLambaster authored and jeremy committed Jun 18, 2010
1 parent bfc05e2 commit a7cae64
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions activerecord/test/cases/adapter_test.rb
Expand Up @@ -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

Expand Down

0 comments on commit a7cae64

Please sign in to comment.