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.



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

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

Instance Attribute Details

#exceptionObject (readonly)

Returns the value of attribute exception.



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

def exception
  @exception
end

Instance Method Details

#error?Boolean

Returns:

  • (Boolean)


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

def error?
  !failure?
end

#failure?Boolean

Returns:

  • (Boolean)


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

def failure?
  @failure.expectation_not_met?
end

#locationObject



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

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

#messageObject



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

def message() exception.message end

#nameObject



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

def name() exception.class.name end