Module: MockSuey::RSpec

Defined in:
lib/mock_suey/rspec.rb,
lib/mock_suey/rspec/mock_context.rb,
lib/mock_suey/rspec/proxy_method_invoked.rb

Defined Under Namespace

Modules: MockContext, ProxyMethodInvokedHook

Class Method Summary collapse

Class Method Details

.register_example_failure(example, err) ⇒ Object



9
10
11
12
13
# File 'lib/mock_suey/rspec.rb', line 9

def register_example_failure(example, err)
  example.execution_result.status = :failed
  example.execution_result.exception = err
  example.set_aggregate_failures_exception(err)
end

.report_non_example_failure(err, location = nil) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/mock_suey/rspec.rb', line 15

def report_non_example_failure(err, location = nil)
  err.set_backtrace([location]) if err.backtrace.nil? && location

  ::RSpec.configuration.reporter.notify_non_example_exception(
    err,
    "An error occurred after suite run."
  )
end