# File lib/rr/wildcard_matchers/hash_including.rb, line 6 def initialize(expected_hash) @expected_hash = expected_hash.clone end
# File lib/rr/wildcard_matchers/hash_including.rb, line 22 def ==(other) return false unless other.is_a?(self.class) self.expected_hash == other.expected_hash end
# File lib/rr/wildcard_matchers/hash_including.rb, line 18 def inspect "hash_including(#{expected_hash.inspect})" end
# File lib/rr/wildcard_matchers/hash_including.rb, line 10 def wildcard_match?(other) return true if self == other expected_hash.each_pair do |key, value| return false unless other.has_key?(key) && other[key] == expected_hash[key] end return true end