Class: RSpec::Core::Example

Inherits:
Object
  • Object
show all
Defined in:
lib/trunk_spec_helper.rb

Overview

Example is the class that represents a test case

Defined Under Namespace

Classes: Procsy

Instance Method Summary collapse

Instance Method Details

#set_exception(exception) ⇒ Object

RSpec uses the existance of an exception to determine if the test failed We need to override this to allow us to capture the exception and then decide if we want to fail the test or not trunk-ignore(rubocop/Naming/AccessorMethodName)



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/trunk_spec_helper.rb', line 21

def set_exception(exception)
  # TODO: this is where we'll need to override the result once the logic is ready
  # trunk-ignore(rubocop/Lint/LiteralAsCondition)
  if true
    set_exception_core(exception)
  else
    # monitor the override in the metadata
    [:quarantined_exception] = exception
    nil
  end
end

#set_exception_coreObject

keep the original method around so we can call it



16
# File 'lib/trunk_spec_helper.rb', line 16

alias set_exception_core set_exception