Skip to content

Commit

Permalink
Move mysql2 test for when adapter will be loaded
Browse files Browse the repository at this point in the history
When run with only the Mysql adapter, we get this failure: https://travis-ci.org/rails/rails/jobs/15937907#L2416

Porting the test over to only run when mysql2 is loaded
  • Loading branch information
schneems committed Dec 24, 2013
1 parent f89c5f4 commit 8e2c080
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 0 additions & 7 deletions activerecord/test/cases/adapters/mysql/mysql_adapter_test.rb
Expand Up @@ -23,13 +23,6 @@ def test_bad_connection_mysql
end
end

def test_bad_connection_mysql2
assert_raise ActiveRecord::NoDatabaseError do
connection = ActiveRecord::Base.mysql2_connection(adapter: "mysql2", database: "should_not_exist-cinco-dog-db")
connection.exec_query('drop table if exists ex')
end
end

def test_valid_column
column = @conn.columns('ex').find { |col| col.name == 'id' }
assert @conn.valid_type?(column.type)
Expand Down
7 changes: 7 additions & 0 deletions activerecord/test/cases/adapters/mysql2/connection_test.rb
Expand Up @@ -13,6 +13,13 @@ def teardown
super
end

def test_bad_connection
assert_raise ActiveRecord::NoDatabaseError do
connection = ActiveRecord::Base.mysql2_connection(adapter: "mysql2", database: "should_not_exist-cinco-dog-db")
connection.exec_query('drop table if exists ex')
end
end

def test_no_automatic_reconnection_after_timeout
assert @connection.active?
@connection.update('set @@wait_timeout=1')
Expand Down

0 comments on commit 8e2c080

Please sign in to comment.