Sha256: eb46051449a6afe4865567254d9e9f0e9bb9f3bb50e2a1432f423fc885f92366

Contents?: true

Size: 596 Bytes

Versions: 9

Compression:

Stored size: 596 Bytes

Contents

module RSpec::RubyContentMatchers    
  def have_remove_column(name)
    HaveCall.new('t.remove', ":#{name}")
  end

  def have_add_column(name, type='string')
    HaveCall.new("t.#{type}", ":#{name}")
  end
  alias_method :have_column, :have_add_column

  def have_columns(columns = {})
    raise ArgumentError, "Columns must be passed as a :name => :type Hash" if !columns.kind_of? Hash
    HaveCalls.new columns
  end

  def have_change_column(name, type='string')
    HaveCall.new("t.change", ":#{name}\s*,\s*:#{type}")
  end

  def have_timestamps
    HaveCall.new("t.timestamps")
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
generator-spec-0.4.7 lib/generator_spec/matchers/migration/have_column.rb
generator-spec-0.4.5 lib/generator_spec/matchers/migration/have_column.rb
generator-spec-0.4.4 lib/generator_spec/matchers/migration/have_column.rb
generator-spec-0.4.3 lib/rspec_for_generators/matchers/migration/have_column.rb
generator-spec-0.4.2 lib/rspec_for_generators/matchers/migration/have_column.rb
generator-spec-0.4.1 lib/rspec_for_generators/matchers/migration/have_column.rb
generator-spec-0.4.0 lib/rspec_for_generators/matchers/migration/have_column.rb
generator-spec-0.3.5 lib/rspec_for_generators/matchers/migration/have_column.rb
generator-spec-0.3.4 lib/rspec_for_generators/matchers/migration/have_column.rb