class RSpec::Trunk
Trunk is a class that is used to monitor the execution of the Example class
def self.setup
def self.setup RSpec.configure do |config| config.around(:each, &:run_with_trunk) end end
def current_example
def current_example @current_example ||= RSpec.current_example end
def initialize(example)
def initialize(example) @example = example end
def run
def run # run the test @example.run # monitor attempts in the metadata if @example.metadata[:attempt_number] @example.metadata[:attempt_number] += 1 else @example.metadata[:attempt_number] = 0 end # add the test to the report # return the report @testreport end