Permalink
Browse files

used user-defined configurations for running tests that might depend …

…on user's system configuration
  • Loading branch information...
1 parent f66f483 commit 143da09f5177d66ccad6a3141f90fc275f01c754 @kuldeepaggarwal kuldeepaggarwal committed Dec 29, 2013
View
3 activerecord/test/cases/adapters/mysql/mysql_adapter_test.rb
@@ -18,7 +18,8 @@ def setup
def test_bad_connection_mysql
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')
end
end
View
3 activerecord/test/cases/adapters/mysql2/connection_test.rb
@@ -15,7 +15,8 @@ def teardown
def test_bad_connection
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')
end
end
View
3 activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb
@@ -12,7 +12,8 @@ def setup
def test_bad_connection
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')
end
end

0 comments on commit 143da09

Please sign in to comment.