Class Spec::Mocks::ArgumentMatchers::HashIncludingMatcher

  1. lib/spec/mocks/argument_matchers.rb
Parent: Object

Methods

public class

  1. new

public instance

  1. ==
  2. description

Public class methods

new (expected)
[show source]
# File lib/spec/mocks/argument_matchers.rb, line 54
        def initialize(expected)
          @expected = expected
        end

Public instance methods

== (actual)
[show source]
# File lib/spec/mocks/argument_matchers.rb, line 58
        def ==(actual)
          @expected.each do | key, value |
            return false unless actual.has_key?(key) && value == actual[key]
          end
          true
        rescue NoMethodError => ex
          return false
        end
description ()
[show source]
# File lib/spec/mocks/argument_matchers.rb, line 67
        def description
          "hash_including(#{@expected.inspect.sub(/^\{/,"").sub(/\}$/,"")})"
        end