Sha256: c250df597157f2efe7349b86cea721dc6109f82187b7ffacdf594f56d8a29b91

Contents?: true

Size: 526 Bytes

Versions: 13

Compression:

Stored size: 526 Bytes

Contents

# frozen_string_literal: true

module WebMock
  module Matchers
    # this is a based on RSpec::Mocks::ArgumentMatchers::HashIncludingMatcher
    # https://github.com/rspec/rspec-mocks/blob/master/lib/rspec/mocks/argument_matchers.rb
    class HashIncludingMatcher < HashArgumentMatcher
      def ==(actual)
        super { |key, value| actual.key?(key) && value === actual[key] }
      rescue NoMethodError
        false
      end

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

Version data entries

13 entries across 13 versions & 4 rubygems

Version Path
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/webmock-3.23.1/lib/webmock/matchers/hash_including_matcher.rb
webmock-3.24.0 lib/webmock/matchers/hash_including_matcher.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/webmock-3.23.1/lib/webmock/matchers/hash_including_matcher.rb
webmock-3.23.0 lib/webmock/matchers/hash_including_matcher.rb
webmock-3.22.0 lib/webmock/matchers/hash_including_matcher.rb
webmock-3.21.2 lib/webmock/matchers/hash_including_matcher.rb
webmock-3.21.1 lib/webmock/matchers/hash_including_matcher.rb
webmock-3.21.0 lib/webmock/matchers/hash_including_matcher.rb
webmock-3.20.0 lib/webmock/matchers/hash_including_matcher.rb
honeybadger-5.4.0 vendor/bundle/ruby/3.2.0/gems/webmock-3.19.1/lib/webmock/matchers/hash_including_matcher.rb
honeybadger-5.3.0 vendor/bundle/ruby/3.2.0/gems/webmock-3.19.1/lib/webmock/matchers/hash_including_matcher.rb
webmock-3.19.1 lib/webmock/matchers/hash_including_matcher.rb
webmock-3.19.0 lib/webmock/matchers/hash_including_matcher.rb