Skip to content

Commit 9192928

Browse files
author
Anna Carey
committed
fix schema_dumper test for UUID
1 parent e98589a commit 9192928

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

test/cases/schema_dumper_test_sqlserver.rb

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def table_dump(*table_names)
7373

7474
class SchemaDumperTest < ActiveRecord::TestCase
7575

76-
COERCED_TESTS = [:test_schema_dump_keeps_large_precision_integer_columns_as_decimal]
76+
COERCED_TESTS = [:test_schema_dump_keeps_large_precision_integer_columns_as_decimal, :test_types_line_up]
7777

7878
include SqlserverCoercedTest
7979

@@ -82,6 +82,20 @@ def test_coerced_schema_dump_keeps_large_precision_integer_columns_as_decimal
8282
assert_match %r{t.decimal\s+"atoms_in_universe",\s+precision: 38,\s+scale: 0}, output
8383
end
8484

85+
def test_coerced_types_line_up
86+
column_definition_lines.each do |column_set|
87+
next if column_set.empty?
88+
89+
lengths = column_set.map do |column|
90+
if match = column.match(/t\.(?:integer|decimal|float|datetime|timestamp|time|date|text|binary|string|boolean|uuid)\s+"/)
91+
match[0].length
92+
end
93+
end
94+
95+
assert_equal 1, lengths.uniq.length
96+
end
97+
end
98+
8599
private
86100

87101
def standard_dump

0 commit comments

Comments
 (0)