From 4b4a548a60236ccfb68c91f53386459bcb1751ab Mon Sep 17 00:00:00 2001 From: Emilio Tagua Date: Tue, 8 Jun 2010 16:32:10 -0400 Subject: Avoid PostgreSQL and MySQL tests warnings. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- activerecord/test/cases/active_schema_test_mysql.rb | 8 +++++--- activerecord/test/cases/active_schema_test_postgresql.rb | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/activerecord/test/cases/active_schema_test_mysql.rb b/activerecord/test/cases/active_schema_test_mysql.rb index 3526f49afd..d7431e5158 100644 --- a/activerecord/test/cases/active_schema_test_mysql.rb +++ b/activerecord/test/cases/active_schema_test_mysql.rb @@ -4,6 +4,7 @@ class ActiveSchemaTest < ActiveRecord::TestCase def setup ActiveRecord::ConnectionAdapters::MysqlAdapter.class_eval do alias_method :execute_without_stub, :execute + remove_method :execute def execute(sql, name = nil) return sql end end end @@ -66,7 +67,7 @@ class ActiveSchemaTest < ActiveRecord::TestCase assert_equal "DROP TABLE `otherdb`.`people`", drop_table('otherdb.people') end - def test_add_timestamps + def test_add_timestamps with_real_execute do begin ActiveRecord::Base.connection.create_table :delete_me do |t| @@ -79,8 +80,8 @@ class ActiveSchemaTest < ActiveRecord::TestCase end end end - - def test_remove_timestamps + + def test_remove_timestamps with_real_execute do begin ActiveRecord::Base.connection.create_table :delete_me do |t| @@ -106,6 +107,7 @@ class ActiveSchemaTest < ActiveRecord::TestCase ensure #before finishing, we restore the alias to the mock-up method ActiveRecord::ConnectionAdapters::MysqlAdapter.class_eval do + remove_method :execute alias_method :execute, :execute_with_stub end end diff --git a/activerecord/test/cases/active_schema_test_postgresql.rb b/activerecord/test/cases/active_schema_test_postgresql.rb index af80f724f2..4f04c6735c 100644 --- a/activerecord/test/cases/active_schema_test_postgresql.rb +++ b/activerecord/test/cases/active_schema_test_postgresql.rb @@ -4,6 +4,7 @@ class PostgresqlActiveSchemaTest < Test::Unit::TestCase def setup ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.class_eval do alias_method :real_execute, :execute + remove_method :execute def execute(sql, name = nil) sql end end end -- cgit v1.2.3