Exception: Expectation::Error
- Inherits:
-
ArgumentError
- Object
- ArgumentError
- Expectation::Error
- Defined in:
- lib/expectation.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) ⇒ Error
constructor
A new instance of Error.
- #to_s ⇒ Object
Constructor Details
#initialize(value, expectation, info = nil) ⇒ Error
Returns a new instance of Error.
36 37 38 39 |
# File 'lib/expectation.rb', line 36 def initialize(value, expectation, info = nil) @value, @expectation, @info = value, expectation, info end |
Instance Attribute Details
#expectation ⇒ Object (readonly)
Returns the value of attribute expectation.
34 35 36 |
# File 'lib/expectation.rb', line 34 def expectation @expectation end |
#info ⇒ Object (readonly)
Returns the value of attribute info.
34 35 36 |
# File 'lib/expectation.rb', line 34 def info @info end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
34 35 36 |
# File 'lib/expectation.rb', line 34 def value @value end |
Instance Method Details
#to_s ⇒ Object
41 42 43 44 45 |
# File 'lib/expectation.rb', line 41 def to_s = "#{value.inspect} does not match #{expectation.inspect}" += ", #{info}" if info end |