Sha256: 7f71e1e53c56a1679299a25e023af798cb5a00967ec5a1e0d580a936bdb107ef

Contents?: true

Size: 575 Bytes

Versions: 69

Compression:

Stored size: 575 Bytes

Contents

module WebMock
  module Matchers
    # Base class for Hash matchers
    # https://github.com/rspec/rspec-mocks/blob/master/lib/rspec/mocks/argument_matchers.rb
    class HashArgumentMatcher
      def initialize(expected)
        @expected = Hash[WebMock::Util::HashKeysStringifier.stringify_keys!(expected, deep: true).sort]
      end

      def ==(_actual, &block)
        @expected.all?(&block)
      rescue NoMethodError
        false
      end

      def self.from_rspec_matcher(matcher)
        new(matcher.instance_variable_get(:@expected))
      end
    end
  end
end

Version data entries

69 entries across 69 versions & 5 rubygems

Version Path
fluent-plugin-google-cloud-logging-on-prem-0.1.0 vendor/ruby/3.1.0/gems/webmock-3.18.1/lib/webmock/matchers/hash_argument_matcher.rb
webmock-3.18.1 lib/webmock/matchers/hash_argument_matcher.rb
webmock-3.18.0 lib/webmock/matchers/hash_argument_matcher.rb
webmock-3.15.2 lib/webmock/matchers/hash_argument_matcher.rb
webmock-3.16.2 lib/webmock/matchers/hash_argument_matcher.rb
webmock-3.16.1 lib/webmock/matchers/hash_argument_matcher.rb
webmock-3.15.1 lib/webmock/matchers/hash_argument_matcher.rb
webmock-3.17.1 lib/webmock/matchers/hash_argument_matcher.rb
webmock-3.17.0 lib/webmock/matchers/hash_argument_matcher.rb
logstash-output-scalyr-0.2.1.beta vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/matchers/hash_argument_matcher.rb
logstash-output-scalyr-0.2.0 vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/matchers/hash_argument_matcher.rb
logstash-output-scalyr-0.2.0.beta vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/matchers/hash_argument_matcher.rb
logstash-output-scalyr-0.1.26.beta vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/matchers/hash_argument_matcher.rb
logstash-output-scalyr-0.1.25.beta vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/matchers/hash_argument_matcher.rb
logstash-output-scalyr-0.1.24.beta vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/matchers/hash_argument_matcher.rb
logstash-output-scalyr-0.1.23.beta vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/matchers/hash_argument_matcher.rb
logstash-output-scalyr-0.1.22.beta vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/matchers/hash_argument_matcher.rb
logstash-output-scalyr-0.1.21.beta vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/matchers/hash_argument_matcher.rb
logstash-output-scalyr-0.1.20.beta vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/matchers/hash_argument_matcher.rb
webmock-3.14.0 lib/webmock/matchers/hash_argument_matcher.rb