Class: CI::Reporter::RSpecFailure

Inherits:
Object
  • Object
show all
Defined in:
lib/ci/reporter/rspec.rb

Overview

Wrapper around a RSpec error or failure to be used by the test suite to interpret results.

Direct Known Subclasses

RSpec2Failure

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(failure) ⇒ RSpecFailure

Returns a new instance of RSpecFailure.



33
34
35
36
# File 'lib/ci/reporter/rspec.rb', line 33

def initialize(failure)
  @failure = failure
  @exception = failure.exception
end

Instance Attribute Details

#exceptionObject (readonly)

Returns the value of attribute exception.



32
33
34
# File 'lib/ci/reporter/rspec.rb', line 32

def exception
  @exception
end

Instance Method Details

#error?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/ci/reporter/rspec.rb', line 42

def error?
  !failure?
end

#failure?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/ci/reporter/rspec.rb', line 38

def failure?
  @failure.expectation_not_met?
end

#locationObject



48
# File 'lib/ci/reporter/rspec.rb', line 48

def location() (exception.backtrace || ["No backtrace available"]).join("\n") end

#messageObject



47
# File 'lib/ci/reporter/rspec.rb', line 47

def message() exception.message end

#nameObject



46
# File 'lib/ci/reporter/rspec.rb', line 46

def name() exception.class.name end