Sha256: 848594871b9f8a89b1e278412c2eff25d2ef3cf44cc547b731ced5e4c9847092
Contents?: true
Size: 609 Bytes
Versions: 9
Compression:
Stored size: 609 Bytes
Contents
class HasEntry def initialize(expected) @expected = expected end def matches?(target) @target = target @expected.all? do |key, value| @target[key] == value end end def failure_message_for_should "expected #{@target.inspect} to have entries #{@expected.inspect}" end def failure_message_for_should_not "expected #{@target.inspect} not to have entries #{@expected.inspect}" end end module HashMatchers def has_entry(expected) HasEntry.new(expected) end alias :has_entries :has_entry alias :have_entries :has_entry alias :have_entry :has_entry end
Version data entries
9 entries across 9 versions & 1 rubygems