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.

Instance Method Summary collapse

Constructor Details

#initialize(failure) ⇒ RSpecFailure

Returns a new instance of RSpecFailure.



18
19
20
# File 'lib/ci/reporter/rspec.rb', line 18

def initialize(failure)
  @failure = failure
end

Instance Method Details

#error?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/ci/reporter/rspec.rb', line 26

def error?
  !@failure.expectation_not_met?
end

#failure?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/ci/reporter/rspec.rb', line 22

def failure?
  @failure.expectation_not_met?
end

#locationObject



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

def location() @failure.exception.backtrace.join("\n") end

#messageObject



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

def message() @failure.exception.message end

#nameObject



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

def name() @failure.exception.class.name end