class WebMock::Matchers::HashArgumentMatcher
Base class for Hash matchers github.com/rspec/rspec-mocks/blob/master/lib/rspec/mocks/argument_matchers.rb
Public Class Methods
Source
# File lib/webmock/matchers/hash_argument_matcher.rb, line 18 def self.from_rspec_matcher(matcher) new(matcher.instance_variable_get(:@expected)) end
Source
# File lib/webmock/matchers/hash_argument_matcher.rb, line 8 def initialize(expected) @expected = Hash[WebMock::Util::HashKeysStringifier.stringify_keys!(expected, deep: true).sort] end
Public Instance Methods
Source
# File lib/webmock/matchers/hash_argument_matcher.rb, line 12 def ==(_actual, &block) @expected.all?(&block) rescue NoMethodError false end