Sha256: c4ea950de108357e48b98ac1ffea861e983a3d77c5b7e953c3039b9bb4067b6f

Contents?: true

Size: 411 Bytes

Versions: 8

Compression:

Stored size: 411 Bytes

Contents

module IdentityMapMatcher
  class BeInIdentityMap
    def matches?(obj)
      @obj = obj
      @obj.identity_map[@obj.store_key] == @obj
    end

    def failure_message
      "expected #{@obj} to be in identity map, but it was not"
    end

    def negative_failure_message
      "expected #{@obj} to not be in identity map, but it was"
    end
  end

  def be_in_identity_map
    BeInIdentityMap.new
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
toystore-0.6.6 spec/support/identity_map_matcher.rb
toystore-0.6.5 spec/support/identity_map_matcher.rb
toystore-0.6.4 spec/support/identity_map_matcher.rb
toystore-0.6.3 spec/support/identity_map_matcher.rb
toystore-0.6.2 spec/support/identity_map_matcher.rb
toystore-0.6.1 spec/support/identity_map_matcher.rb
toystore-0.6 spec/support/identity_map_matcher.rb
toystore-0.5 spec/support/identity_map_matcher.rb