Sha256: 2a074f51ae9a1340ea551e31c12528890ce723cd133ddac4414ac055c34bb13a
Contents?: true
Size: 545 Bytes
Versions: 30
Compression:
Stored size: 545 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 end
Version data entries
30 entries across 30 versions & 3 rubygems