diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-07-29 12:23:37 -0700 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2011-08-13 16:22:24 -0700 |
commit | 17a66a8ddc5a2ee8263d1dcc86a032322cb8e615 (patch) | |
tree | 693acfb9432b142bca528c537c1bbda18bdf3755 /activerecord/test/cases/schema_dumper_test.rb | |
parent | 55fb1780a0695bc60ba7ab91084026d45c36b43e (diff) | |
download | rails-17a66a8ddc5a2ee8263d1dcc86a032322cb8e615.tar.gz rails-17a66a8ddc5a2ee8263d1dcc86a032322cb8e615.tar.bz2 rails-17a66a8ddc5a2ee8263d1dcc86a032322cb8e615.zip |
dump IO encoding value along with schema.rb so the file can be reloaded. fixes #1592
Diffstat (limited to 'activerecord/test/cases/schema_dumper_test.rb')
-rw-r--r-- | activerecord/test/cases/schema_dumper_test.rb | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/activerecord/test/cases/schema_dumper_test.rb b/activerecord/test/cases/schema_dumper_test.rb index 4adecf8e83..5da3f59a1f 100644 --- a/activerecord/test/cases/schema_dumper_test.rb +++ b/activerecord/test/cases/schema_dumper_test.rb @@ -3,11 +3,20 @@ require 'stringio' class SchemaDumperTest < ActiveRecord::TestCase + def setup + @stream = StringIO.new + end + def standard_dump - stream = StringIO.new + @stream = StringIO.new ActiveRecord::SchemaDumper.ignore_tables = [] - ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection, stream) - stream.string + ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection, @stream) + @stream.string + end + + def test_magic_comment + skip "only test magic comments on 1.9" if RUBY_VERSION < '1.9' + assert_match "# encoding: #{@stream.external_encoding.name}", standard_dump end def test_schema_dump |