From 40d8d77c6454a9f5ff1a9bc941d039c62deb7a79 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Thu, 6 Jul 2006 17:30:54 +0000 Subject: Rename test file so it runs for MySQL only. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4571 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/test/active_schema_mysql_test.rb | 31 --------------------------- activerecord/test/active_schema_test_mysql.rb | 31 +++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 31 deletions(-) delete mode 100644 activerecord/test/active_schema_mysql_test.rb create mode 100644 activerecord/test/active_schema_test_mysql.rb diff --git a/activerecord/test/active_schema_mysql_test.rb b/activerecord/test/active_schema_mysql_test.rb deleted file mode 100644 index b72223526a..0000000000 --- a/activerecord/test/active_schema_mysql_test.rb +++ /dev/null @@ -1,31 +0,0 @@ -require 'abstract_unit' - -class ActiveSchemaTest < Test::Unit::TestCase - def setup - ActiveRecord::ConnectionAdapters::MysqlAdapter.class_eval do - alias_method :real_execute, :execute - def execute(sql, name = nil) return sql end - end - end - - def teardown - ActiveRecord::ConnectionAdapters::MysqlAdapter.send(:alias_method, :execute, :real_execute) - end - - def test_drop_table - assert_equal "DROP TABLE people", drop_table(:people) - end - - def test_add_column - assert_equal "ALTER TABLE people ADD `last_name` varchar(255)", add_column(:people, :last_name, :string) - end - - def test_add_column_with_limit - assert_equal "ALTER TABLE people ADD `key` varchar(32)", add_column(:people, :key, :string, :limit => 32) - end - - private - def method_missing(method_symbol, *arguments) - ActiveRecord::Base.connection.send(method_symbol, *arguments) - end -end \ No newline at end of file diff --git a/activerecord/test/active_schema_test_mysql.rb b/activerecord/test/active_schema_test_mysql.rb new file mode 100644 index 0000000000..b72223526a --- /dev/null +++ b/activerecord/test/active_schema_test_mysql.rb @@ -0,0 +1,31 @@ +require 'abstract_unit' + +class ActiveSchemaTest < Test::Unit::TestCase + def setup + ActiveRecord::ConnectionAdapters::MysqlAdapter.class_eval do + alias_method :real_execute, :execute + def execute(sql, name = nil) return sql end + end + end + + def teardown + ActiveRecord::ConnectionAdapters::MysqlAdapter.send(:alias_method, :execute, :real_execute) + end + + def test_drop_table + assert_equal "DROP TABLE people", drop_table(:people) + end + + def test_add_column + assert_equal "ALTER TABLE people ADD `last_name` varchar(255)", add_column(:people, :last_name, :string) + end + + def test_add_column_with_limit + assert_equal "ALTER TABLE people ADD `key` varchar(32)", add_column(:people, :key, :string, :limit => 32) + end + + private + def method_missing(method_symbol, *arguments) + ActiveRecord::Base.connection.send(method_symbol, *arguments) + end +end \ No newline at end of file -- cgit v1.2.3