Exception: Megatest::UnexpectedError
- Defined in:
- lib/megatest/assertions.rb
Instance Attribute Summary collapse
-
#cause ⇒ Object
readonly
Returns the value of attribute cause.
Instance Method Summary collapse
- #backtrace ⇒ Object
- #backtrace_locations ⇒ Object
-
#initialize(cause, method = nil) ⇒ UnexpectedError
constructor
A new instance of UnexpectedError.
Constructor Details
#initialize(cause, method = nil) ⇒ UnexpectedError
Returns a new instance of UnexpectedError.
26 27 28 29 30 31 32 33 34 |
# File 'lib/megatest/assertions.rb', line 26 def initialize(cause, method = nil) if method super("Unexpected exception in #{method} block") else super("Unexpected exception") end @method = method @cause = cause end |
Instance Attribute Details
#cause ⇒ Object (readonly)
Returns the value of attribute cause.
24 25 26 |
# File 'lib/megatest/assertions.rb', line 24 def cause @cause end |
Instance Method Details
#backtrace ⇒ Object
36 37 38 |
# File 'lib/megatest/assertions.rb', line 36 def backtrace cause.backtrace end |
#backtrace_locations ⇒ Object
40 41 42 |
# File 'lib/megatest/assertions.rb', line 40 def backtrace_locations cause.backtrace_locations end |