Skip to content

Commit

Permalink
Merge pull request rails#13527 from kuldeepaggarwal/f-independent-specs
Browse files Browse the repository at this point in the history
Use user-defined configurations in mysql tests
  • Loading branch information
José Valim committed Dec 29, 2013
2 parents 524ad8f + 143da09 commit 1072145
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion activerecord/test/cases/adapters/mysql/mysql_adapter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion activerecord/test/cases/adapters/mysql2/connection_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1072145

Please sign in to comment.