Sha256: 8188911eac0c4ee4c9f6dd118012b6dfda01ec1ebc0be59526b2ae919f4f955d

Contents?: true

Size: 745 Bytes

Versions: 3

Compression:

Stored size: 745 Bytes

Contents

require 'spec_helper'

describe ActiveRecord::SchemaDumper do
  before(:all) do
    stream = StringIO.new
    ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection, stream)
    @dump = stream.string
  end

  it 'dumps table comments' do
    @dump.should =~ /set_table_comment 'vegetables', 'Healthy and delicious'/
  end

  it 'dumps column comments' do
    @dump.should =~ /set_column_comment 'vegetables', 'name', 'The name of the vegetable'/
    @dump.should =~ /set_column_comment 'vegetables', 'price', 'vegetable cost'/
    @dump.should =~ /set_column_comment 'vegetables', 'comment', 'thoughts'/
  end

  it 'dumps index comments' do
    @dump.should =~ /set_index_comment 'index_vegetables_on_name', 'Comment on index'/
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pg_comment-0.3.0 spec/lib/pg_comment/schema_dumper_spec.rb
pg_comment-0.2.1 spec/lib/pg_comment/schema_dumper_spec.rb
pg_comment-0.2.0 spec/lib/pg_comment/schema_dumper_spec.rb