aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/schema_dumper_test.rb
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2015-01-19 07:29:32 +0900
committerRyuta Kamizono <kamipo@gmail.com>2015-01-30 13:40:29 +0900
commitadd37bd645f686e8083d61a52f68efe2fd2a49d0 (patch)
tree94de7e02184ec2210c8b07ef10772e28473a76cc /activerecord/test/cases/schema_dumper_test.rb
parent455e663c667a3c97e37b71b52100a965b384f2f7 (diff)
downloadrails-add37bd645f686e8083d61a52f68efe2fd2a49d0.tar.gz
rails-add37bd645f686e8083d61a52f68efe2fd2a49d0.tar.bz2
rails-add37bd645f686e8083d61a52f68efe2fd2a49d0.zip
Fix `test_types_line_up` when column type missing
a column type `xml` is missing in regexp pattarn. However, `assert_equal 1, lengths.uniq.length` is success when `lengths` are all `nil` because a column type is missing. a test will be failed by using `compact` when a column type is missing.
Diffstat (limited to 'activerecord/test/cases/schema_dumper_test.rb')
-rw-r--r--activerecord/test/cases/schema_dumper_test.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/test/cases/schema_dumper_test.rb b/activerecord/test/cases/schema_dumper_test.rb
index c8ea702488..bafc9fa81b 100644
--- a/activerecord/test/cases/schema_dumper_test.rb
+++ b/activerecord/test/cases/schema_dumper_test.rb
@@ -73,10 +73,10 @@ class SchemaDumperTest < ActiveRecord::TestCase
next if column_set.empty?
lengths = column_set.map do |column|
- if match = column.match(/t\.(?:integer|decimal|float|datetime|timestamp|time|date|text|binary|string|boolean|uuid|point)\s+"/)
+ if match = column.match(/t\.(?:integer|decimal|float|datetime|timestamp|time|date|text|binary|string|boolean|xml|uuid|point)\s+"/)
match[0].length
end
- end
+ end.compact
assert_equal 1, lengths.uniq.length
end