aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorSean Griffin <sean@seantheprogrammer.com>2016-01-10 19:03:07 -0700
committerSean Griffin <sean@seantheprogrammer.com>2016-01-10 19:03:07 -0700
commit5465224892281a088422df438e4fc0ce7f6c8f5e (patch)
tree60d3260a104dd16a3ba005d079d9f809a5ccb10c /activerecord/test/cases
parent0cffe1b316b010b53dd5b5c6a63e4082d23e216d (diff)
parent560bf1c939d6928bc4debaf32178ed811d46c052 (diff)
downloadrails-5465224892281a088422df438e4fc0ce7f6c8f5e.tar.gz
rails-5465224892281a088422df438e4fc0ce7f6c8f5e.tar.bz2
rails-5465224892281a088422df438e4fc0ce7f6c8f5e.zip
Merge pull request #22998 from kamipo/extract_mysql_column_class
Extract `MySQL::{Column|TypeMetadata}` classes to the appropriate files
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/column_definition_test.rb22
1 files changed, 11 insertions, 11 deletions
diff --git a/activerecord/test/cases/column_definition_test.rb b/activerecord/test/cases/column_definition_test.rb
index 783a374116..81162b7e98 100644
--- a/activerecord/test/cases/column_definition_test.rb
+++ b/activerecord/test/cases/column_definition_test.rb
@@ -41,49 +41,49 @@ module ActiveRecord
if current_adapter?(:Mysql2Adapter)
def test_should_set_default_for_mysql_binary_data_types
type = SqlTypeMetadata.new(type: :binary, sql_type: "binary(1)")
- binary_column = AbstractMysqlAdapter::Column.new("title", "a", type)
+ binary_column = MySQL::Column.new("title", "a", type)
assert_equal "a", binary_column.default
type = SqlTypeMetadata.new(type: :binary, sql_type: "varbinary")
- varbinary_column = AbstractMysqlAdapter::Column.new("title", "a", type)
+ varbinary_column = MySQL::Column.new("title", "a", type)
assert_equal "a", varbinary_column.default
end
def test_should_be_empty_string_default_for_mysql_binary_data_types
type = SqlTypeMetadata.new(type: :binary, sql_type: "binary(1)")
- binary_column = AbstractMysqlAdapter::Column.new("title", "", type, false)
+ binary_column = MySQL::Column.new("title", "", type, false)
assert_equal "", binary_column.default
type = SqlTypeMetadata.new(type: :binary, sql_type: "varbinary")
- varbinary_column = AbstractMysqlAdapter::Column.new("title", "", type, false)
+ varbinary_column = MySQL::Column.new("title", "", type, false)
assert_equal "", varbinary_column.default
end
def test_should_not_set_default_for_blob_and_text_data_types
assert_raise ArgumentError do
- AbstractMysqlAdapter::Column.new("title", "a", SqlTypeMetadata.new(sql_type: "blob"))
+ MySQL::Column.new("title", "a", SqlTypeMetadata.new(sql_type: "blob"))
end
- text_type = AbstractMysqlAdapter::MysqlTypeMetadata.new(
+ text_type = MySQL::TypeMetadata.new(
SqlTypeMetadata.new(type: :text))
assert_raise ArgumentError do
- AbstractMysqlAdapter::Column.new("title", "Hello", text_type)
+ MySQL::Column.new("title", "Hello", text_type)
end
- text_column = AbstractMysqlAdapter::Column.new("title", nil, text_type)
+ text_column = MySQL::Column.new("title", nil, text_type)
assert_equal nil, text_column.default
- not_null_text_column = AbstractMysqlAdapter::Column.new("title", nil, text_type, false)
+ not_null_text_column = MySQL::Column.new("title", nil, text_type, false)
assert_equal "", not_null_text_column.default
end
def test_has_default_should_return_false_for_blob_and_text_data_types
binary_type = SqlTypeMetadata.new(sql_type: "blob")
- blob_column = AbstractMysqlAdapter::Column.new("title", nil, binary_type)
+ blob_column = MySQL::Column.new("title", nil, binary_type)
assert !blob_column.has_default?
text_type = SqlTypeMetadata.new(type: :text)
- text_column = AbstractMysqlAdapter::Column.new("title", nil, text_type)
+ text_column = MySQL::Column.new("title", nil, text_type)
assert !text_column.has_default?
end
end