Exception: Megatest::UnexpectedError

Inherits:
Assertion
  • Object
show all
Defined in:
lib/megatest/assertions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#causeObject (readonly)

Returns the value of attribute cause.



24
25
26
# File 'lib/megatest/assertions.rb', line 24

def cause
  @cause
end

Instance Method Details

#backtraceObject



36
37
38
# File 'lib/megatest/assertions.rb', line 36

def backtrace
  cause.backtrace
end

#backtrace_locationsObject



40
41
42
# File 'lib/megatest/assertions.rb', line 40

def backtrace_locations
  cause.backtrace_locations
end