Sha256: 3dfb009ee0e30ae97f33489d149fc32e253a0588fb352555319cbb5216dcf5f9

Contents?: true

Size: 322 Bytes

Versions: 2

Compression:

Stored size: 322 Bytes

Contents

RSpec::Matchers.define :clear_hash_when_cleared do |property|
  match do |object|
    object.send(property.to_sym)['key'] = 'value'
    object.clear!
    expect(object.send(property.to_sym)).to be_empty
  end

  failure_message do
    "Expected #{object} to clear #{property} hash after clear!, but it did not."
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fake_braintree-0.8.0 spec/support/matchers/clear_hash_when_cleared.rb
fake_braintree-0.7.0 spec/support/matchers/clear_hash_when_cleared.rb