Class: RSpec::Mocks::ArgumentMatchers::HashExcludingMatcher
- Inherits:
-
Object
- Object
- RSpec::Mocks::ArgumentMatchers::HashExcludingMatcher
- Defined in:
- lib/rspec/mocks/argument_matchers.rb
Instance Method Summary (collapse)
- - (Object) ==(actual)
- - (Object) description
-
- (HashExcludingMatcher) initialize(expected)
constructor
A new instance of HashExcludingMatcher.
Constructor Details
- (HashExcludingMatcher) initialize(expected)
A new instance of HashExcludingMatcher
71 72 73 |
# File 'lib/rspec/mocks/argument_matchers.rb', line 71 def initialize(expected) @expected = expected end |
Instance Method Details
- (Object) ==(actual)
75 76 77 78 79 |
# File 'lib/rspec/mocks/argument_matchers.rb', line 75 def ==(actual) @expected.none? {|k,v| actual.has_key?(k) && v == actual[k]} rescue NoMethodError false end |
- (Object) description
81 82 83 |
# File 'lib/rspec/mocks/argument_matchers.rb', line 81 def description "hash_not_including(#{@expected.inspect.sub(/^\{/,"").sub(/\}$/,"")})" end |