Sha256: f3b5b42cb295cf040441839591de9eec10bcaba493b82abe1d5a240ca492a69a

Contents?: true

Size: 496 Bytes

Versions: 2

Compression:

Stored size: 496 Bytes

Contents

RSpec::Matchers.define :have_attribute_values do |expected|
  match do |actual|
    actual.has_attribute_values?(expected)
  end

  failure_message_for_should do |actual|
    %(expected: #{expected.symbolize_keys.inspect}\n) +
    %(     got: #{actual.attributes.slice(*expected.stringify_keys.keys).symbolize_keys.inspect})
  end

  failure_message_for_should_not do |actual|
    %(expected #{actual.inspect}\n) +
    %(not to have attribute values #{expected.symbolize_keys.inspect})
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
active_record_ignored_attributes-0.0.4 lib/active_record_ignored_attributes/matchers/have_attribute_values.rb
active_record_ignored_attributes-0.0.3 lib/active_record_ignored_attributes/matchers/have_attribute_values.rb