Sha256: 0a811f2dd9e55ae2861c27412b6f358d04f40684f8639249edec30a3ee66c044

Contents?: true

Size: 1.23 KB

Versions: 3

Compression:

Stored size: 1.23 KB

Contents

require 'spec_helper'

describe PgComment::ConnectionAdapters::SchemaDefinitions do
  class TableStub
    include ::PgComment::ConnectionAdapters::Table

    attr_reader :table_name, :base

    def initialize
      @table_name = :foo
      @base = OpenStruct.new
    end
  end

  let (:table_stub){ TableStub.new }

  it '.set_table_comment' do
    table_stub.base.should_receive(:set_table_comment).with(:foo, :bar)
    table_stub.set_table_comment :bar
  end

  it '.remove_table_comment' do
    table_stub.base.should_receive(:remove_table_comment).with(:foo)
    table_stub.remove_table_comment
  end

  it '.set_column_comment' do
    table_stub.base.should_receive(:set_column_comment).with(:foo, :bar, :baz)
    table_stub.set_column_comment(:bar, :baz)
  end

  it '.set_column_comments' do
    table_stub.base.should_receive(:set_column_comments).with(:foo, :bar)
    table_stub.set_column_comments(:bar)
  end

  it '.remove_column_comment' do
    table_stub.base.should_receive(:remove_column_comment).with(:foo, :bar)
    table_stub.remove_column_comment(:bar)
  end

  it '.remove_column_comments' do
    table_stub.base.should_receive(:remove_column_comments).with(:foo, :bar, :baz)
    table_stub.remove_column_comments(:bar, :baz)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pg_comment-0.3.0 spec/lib/pg_comment/connection_adapters/abstract/schema_definitions_spec.rb
pg_comment-0.2.1 spec/lib/pg_comment/connection_adapters/abstract/schema_definitions_spec.rb
pg_comment-0.2.0 spec/lib/pg_comment/connection_adapters/abstract/schema_definitions_spec.rb