Method: RSpec::Core::Example#set_exception

Defined in:
lib/trunk_spec_helper.rb

#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