aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/schema_dumper_test.rb
blob: 72ce1bce4271ee6c03c5f69bdc22b711384c7470 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
require 'abstract_unit'
require "#{File.dirname(__FILE__)}/../lib/active_record/schema_dumper"
require 'stringio'

if ActiveRecord::Base.connection.respond_to?(:tables)
  unless current_adapter?(:OCIAdapter)

    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
end