Class: ElabsMatchers::Matchers::ContainHash::ContainHashMatcher
- Inherits:
-
Struct
- Object
- Struct
- ElabsMatchers::Matchers::ContainHash::ContainHashMatcher
- Defined in:
- lib/elabs_matchers/matchers/contain_hash.rb
Instance Attribute Summary collapse
-
#actual ⇒ Object
Returns the value of attribute actual.
-
#expected ⇒ Object
Returns the value of attribute expected.
Instance Method Summary collapse
- #failure_message ⇒ Object (also: #failure_message_for_should)
- #failure_message_when_negated ⇒ Object (also: #failure_message_for_should_not)
- #matches?(actual) ⇒ Boolean
Instance Attribute Details
#actual ⇒ Object
Returns the value of attribute actual
6 7 8 |
# File 'lib/elabs_matchers/matchers/contain_hash.rb', line 6 def actual @actual end |
#expected ⇒ Object
Returns the value of attribute expected
6 7 8 |
# File 'lib/elabs_matchers/matchers/contain_hash.rb', line 6 def expected @expected end |
Instance Method Details
#failure_message ⇒ Object Also known as: failure_message_for_should
12 13 14 |
# File 'lib/elabs_matchers/matchers/contain_hash.rb', line 12 def "Expected #{expected.inspect} to exist in #{actual.inspect} but it did not." end |
#failure_message_when_negated ⇒ Object Also known as: failure_message_for_should_not
17 18 19 |
# File 'lib/elabs_matchers/matchers/contain_hash.rb', line 17 def "Expected #{expected.inspect} to not exist in #{actual.inspect} but it did." end |
#matches?(actual) ⇒ Boolean
7 8 9 10 |
# File 'lib/elabs_matchers/matchers/contain_hash.rb', line 7 def matches?(actual) self.actual = actual contains?(expected, actual) end |