Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

Use user-defined configurations in mysql tests
  • Loading branch information...
commit 10721450dec7b9730cb7ea99d8f8b5978a33d561 2 parents 524ad8f + 143da09
@josevalim josevalim authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.