diff options
author | Master Lambaster <MasterLambaster@gmail.com> | 2010-05-25 16:11:23 +0300 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2010-06-18 15:28:14 -0700 |
commit | a7cae64104008b124c834b839887bbbbe148219b (patch) | |
tree | 9b6106fffa13d9ff322aa7e78dbb8784e7474cc1 /activerecord/test | |
parent | bfc05e244cf9ca81c7fc7d6ee90a9c8b688bf86c (diff) | |
download | rails-a7cae64104008b124c834b839887bbbbe148219b.tar.gz rails-a7cae64104008b124c834b839887bbbbe148219b.tar.bz2 rails-a7cae64104008b124c834b839887bbbbe148219b.zip |
Fix test which prevents connection reset on failing and remove hardcoded connection
[#4689 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/adapter_test.rb | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/activerecord/test/cases/adapter_test.rb b/activerecord/test/cases/adapter_test.rb index fc08c2178a..646aa88d80 100644 --- a/activerecord/test/cases/adapter_test.rb +++ b/activerecord/test/cases/adapter_test.rb @@ -65,15 +65,14 @@ class AdapterTest < ActiveRecord::TestCase 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 |