diff options
Diffstat (limited to 'activerecord/test/schema_dumper_test.rb')
-rw-r--r-- | activerecord/test/schema_dumper_test.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/activerecord/test/schema_dumper_test.rb b/activerecord/test/schema_dumper_test.rb new file mode 100644 index 0000000000..e24724c9f8 --- /dev/null +++ b/activerecord/test/schema_dumper_test.rb @@ -0,0 +1,19 @@ +require 'abstract_unit' +require "#{File.dirname(__FILE__)}/../lib/active_record/schema_dumper" +require 'stringio' + +if ActiveRecord::Base.connection.respond_to?(:tables) + + class SchemaDumperTest < Test::Unit::TestCase + def test_schema_dump + stream = StringIO.new + ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection, stream) + output = stream.string + + assert_match %r{create_table "accounts"}, output + assert_match %r{create_table "authors"}, output + assert_no_match %r{create_table "schema_info"}, output + end + end + +end |