1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #13527 from kuldeepaggarwal/f-independent-specs

Use user-defined configurations in mysql tests
This commit is contained in:
José Valim 2013-12-29 12:32:06 -08:00
commit 10721450de
3 changed files with 6 additions and 3 deletions

View file

@ -18,7 +18,8 @@ module ActiveRecord
def test_bad_connection_mysql def test_bad_connection_mysql
assert_raise ActiveRecord::NoDatabaseError do assert_raise ActiveRecord::NoDatabaseError do
connection = ActiveRecord::Base.mysql_connection(adapter: "mysql", database: "should_not_exist-cinco-dog-db") configuration = ActiveRecord::Base.configurations['arunit'].merge(database: 'should_not_exist-cinco-dog-db')
connection = ActiveRecord::Base.mysql_connection(configuration)
connection.exec_query('drop table if exists ex') connection.exec_query('drop table if exists ex')
end end
end end

View file

@ -15,7 +15,8 @@ class MysqlConnectionTest < ActiveRecord::TestCase
def test_bad_connection def test_bad_connection
assert_raise ActiveRecord::NoDatabaseError do assert_raise ActiveRecord::NoDatabaseError do
connection = ActiveRecord::Base.mysql2_connection(adapter: "mysql2", database: "should_not_exist-cinco-dog-db") configuration = ActiveRecord::Base.configurations['arunit'].merge(database: 'should_not_exist-cinco-dog-db')
connection = ActiveRecord::Base.mysql2_connection(configuration)
connection.exec_query('drop table if exists ex') connection.exec_query('drop table if exists ex')
end end
end end

View file

@ -12,7 +12,8 @@ module ActiveRecord
def test_bad_connection def test_bad_connection
assert_raise ActiveRecord::NoDatabaseError do assert_raise ActiveRecord::NoDatabaseError do
connection = ActiveRecord::Base.postgresql_connection(database: "should_not_exist-cinco-dog-db", adapter: "postgresql") configuration = ActiveRecord::Base.configurations['arunit'].merge(database: 'should_not_exist-cinco-dog-db')
connection = ActiveRecord::Base.postgresql_connection(configuration)
connection.exec_query('drop table if exists ex') connection.exec_query('drop table if exists ex')
end end
end end