Sha256: 71debfd8a3252f77003a212f0c167296ed37da0804b3debebfc73aee5cdad381

Contents?: true

Size: 437 Bytes

Versions: 9

Compression:

Stored size: 437 Bytes

Contents

RSpec::Matchers.define :have_column do |column_name|
  chain :with_default do |default|
    @default = default
  end

  match do |columns|
    column = columns.detect{|column| column.name == column_name }
    column && column.default.to_s == @default.to_s
  end

  failure_message_for_should do |columns|
    "expected to find '#{column_name}', default '#{@default}' in #{columns.map{|column| [column.name, column.default] }}"
  end
end

Version data entries

9 entries across 7 versions & 2 rubygems

Version Path
solidus_backend-1.0.0.pre3 vendor/bundle/gems/paperclip-4.2.4/spec/support/matchers/have_column.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/paperclip-4.2.4/spec/support/matchers/have_column.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/paperclip-4.2.2/spec/support/matchers/have_column.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/paperclip-4.2.3/spec/support/matchers/have_column.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/paperclip-4.2.4/spec/support/matchers/have_column.rb
paperclip-4.2.4 spec/support/matchers/have_column.rb
paperclip-4.2.3 spec/support/matchers/have_column.rb
paperclip-4.2.2 spec/support/matchers/have_column.rb
paperclip-4.2.1 spec/support/matchers/have_column.rb