Class: WebMock::Matchers::HashExcludingMatcher

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

Overview

this is a based on RSpec::Mocks::ArgumentMatchers::HashExcludingMatcher 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



8
9
10
# File 'lib/webmock/matchers/hash_excluding_matcher.rb', line 8

def ==(actual)
  super { |key, value| !actual.key?(key) || value != actual[key] }
end

#inspectObject



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

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