Class | Spec::Mocks::HashIncludingConstraint
In: | lib/spec/mocks/argument_expectation.rb
Parent: | Object

### Methods

== description matches? new

### Public Class methods

new(expected)

[Source]

         # File lib/spec/mocks/argument_expectation.rb, line 113
    113:       def initialize(expected)
    114:         @expected = expected
    115:       end

### Public Instance methods

==(actual)

[Source]

         # File lib/spec/mocks/argument_expectation.rb, line 117
    117:       def ==(actual)
    118:         @expected.each do | key, value |
    119:           # check key for case that value evaluates to nil
    120:           return false unless actual.has_key?(key) && actual[key] == value
    121:         end
    122:         true
    123:       rescue NoMethodError => ex
    124:         return false
    125:       end

description()

[Source]

         # File lib/spec/mocks/argument_expectation.rb, line 131
    131:       def description
    132:         "hash_including(#{@expected.inspect.sub(/^\{/,"").sub(/\}$/,"")})"
    133:       end

matches?(value)

[Source]

         # File lib/spec/mocks/argument_expectation.rb, line 127
    127:       def matches?(value)
    128:         self == value
    129:       end

[Validate]