Class: WebMock::Matchers::HashIncludingMatcher

Inherits:
HashArgumentMatcher show all
Defined in:
lib/webmock/matchers/hash_including_matcher.rb

Overview

this is a based on RSpec::Mocks::ArgumentMatchers::HashIncludingMatcher github.com/rspec/rspec-mocks/blob/master/lib/rspec/mocks/argument_matchers.rb

Instance Method Summary collapse

Methods inherited from HashArgumentMatcher

from_rspec_matcher, #initialize

Constructor Details

This class inherits a constructor from WebMock::Matchers::HashArgumentMatcher

Instance Method Details

#==(actual) ⇒ Object



6
7
8
9
10
# File 'lib/webmock/matchers/hash_including_matcher.rb', line 6

def ==(actual)
  super { |key, value| actual.key?(key) && value === actual[key] }
rescue NoMethodError
  false
end

#inspectObject



12
13
14
# File 'lib/webmock/matchers/hash_including_matcher.rb', line 12

def inspect
  "hash_including(#{@expected.inspect})"
end