aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorEmilio Tagua <miloops@gmail.com>2010-06-08 16:32:10 -0400
committerJosé Valim <jose.valim@gmail.com>2010-06-08 22:36:19 +0200
commit4b4a548a60236ccfb68c91f53386459bcb1751ab (patch)
treea8a8c1eee7ef0775aa7a09f57c45f4b059b8870c /activerecord/test
parent03be27092bf51e78d0d3f3ee7fd0213023d43e0d (diff)
downloadrails-4b4a548a60236ccfb68c91f53386459bcb1751ab.tar.gz
rails-4b4a548a60236ccfb68c91f53386459bcb1751ab.tar.bz2
rails-4b4a548a60236ccfb68c91f53386459bcb1751ab.zip
Avoid PostgreSQL and MySQL tests warnings.
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/active_schema_test_mysql.rb8
-rw-r--r--activerecord/test/cases/active_schema_test_postgresql.rb1
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