aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/schema_dumper_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/schema_dumper_test.rb')
-rw-r--r--activerecord/test/schema_dumper_test.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/activerecord/test/schema_dumper_test.rb b/activerecord/test/schema_dumper_test.rb
index 37e8a99048..21e47ce609 100644
--- a/activerecord/test/schema_dumper_test.rb
+++ b/activerecord/test/schema_dumper_test.rb
@@ -7,6 +7,7 @@ if ActiveRecord::Base.connection.respond_to?(:tables)
class SchemaDumperTest < Test::Unit::TestCase
def standard_dump
stream = StringIO.new
+ ActiveRecord::SchemaDumper.ignore_tables = []
ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection, stream)
stream.string
end
@@ -30,7 +31,7 @@ if ActiveRecord::Base.connection.respond_to?(:tables)
def test_arguments_line_up
output = standard_dump
output.scan(/^( *)create_table.*?\n(.*?)^\1end/m).map{ |m| m.last.split(/\n/) }.each do |column_set|
- assert_line_up(column_set, /:(?:integer|float|datetime|timestamp|time|date|text|binary|string|boolean)/, true)
+ assert_line_up(column_set, /:(?:integer|decimal|float|datetime|timestamp|time|date|text|binary|string|boolean)/, true)
assert_line_up(column_set, /:default => /)
assert_line_up(column_set, /:limit => /)
assert_line_up(column_set, /:null => /)
@@ -82,6 +83,14 @@ if ActiveRecord::Base.connection.respond_to?(:tables)
ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection, stream)
end
end
+
+ def test_schema_dump_includes_decimal_options
+ stream = StringIO.new
+ ActiveRecord::SchemaDumper.ignore_tables = [/^[^n]/]
+ ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection, stream)
+ output = stream.string
+ assert_match %r{:precision => 3,[[:space:]]+:scale => 2,[[:space:]]+:default => 0.278E1}, output
+ end
end
end