Exception: Muack::Unexpected
- Defined in:
- lib/muack/failure.rb
Instance Attribute Summary collapse
-
#was ⇒ Object
readonly
Returns the value of attribute was.
Attributes inherited from Failure
Instance Method Summary collapse
-
#initialize(obj, expected_defis, msg, args) ⇒ Unexpected
constructor
A new instance of Unexpected.
Methods inherited from Failure
Constructor Details
#initialize(obj, expected_defis, msg, args) ⇒ Unexpected
Returns a new instance of Unexpected.
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/muack/failure.rb', line 15 def initialize obj, expected_defis, msg, args @was = "#{obj.inspect}.#{msg}(" \ "#{args.map(&:inspect).join(', ')})" if expected_defis.empty? super("\nUnexpected call: #{@was}") else build_expected(obj, expected_defis) super("\nExpected: #{expected}\n but was: #{was}") end end |
Instance Attribute Details
#was ⇒ Object (readonly)
Returns the value of attribute was.
14 15 16 |
# File 'lib/muack/failure.rb', line 14 def was @was end |