Exception: Expectation::Matcher::Mismatch
- Inherits:
-
ArgumentError
- Object
- ArgumentError
- Expectation::Matcher::Mismatch
- Defined in:
- lib/expectation/matcher.rb
Instance Attribute Summary collapse
-
#expectation ⇒ Object
readonly
Returns the value of attribute expectation.
-
#info ⇒ Object
readonly
Returns the value of attribute info.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(value, expectation, info = nil) ⇒ Mismatch
constructor
A new instance of Mismatch.
- #to_s ⇒ Object
Constructor Details
#initialize(value, expectation, info = nil) ⇒ Mismatch
Returns a new instance of Mismatch.
15 16 17 18 19 |
# File 'lib/expectation/matcher.rb', line 15 def initialize(value, expectation, info = nil) @value = value @expectation = expectation @info = info end |
Instance Attribute Details
#expectation ⇒ Object (readonly)
Returns the value of attribute expectation.
13 14 15 |
# File 'lib/expectation/matcher.rb', line 13 def expectation @expectation end |
#info ⇒ Object (readonly)
Returns the value of attribute info.
13 14 15 |
# File 'lib/expectation/matcher.rb', line 13 def info @info end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
13 14 15 |
# File 'lib/expectation/matcher.rb', line 13 def value @value end |
Instance Method Details
#to_s ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/expectation/matcher.rb', line 21 def to_s = "#{value.inspect} does not match #{expectation.inspect}" case info when nil then when Fixnum then "#{}, at index #{info}" else "#{}, at key #{info.inspect}" end end |