class Cucumber::Core::Test::Mapping
def execute
def execute @timer.start @block.call passed rescue Result::Pending => exception pending(exception) rescue Exception => exception failed(exception) end
def failed(exception)
def failed(exception) Result::Failed.new(@timer.duration, exception) end
def initialize(&block)
def initialize(&block) raise ArgumentError, "Passing a block to execute the mapping is mandatory." unless block @block = block @timer = Timer.new end
def passed
def passed Result::Passed.new(@timer.duration) end
def pending(exception)
def pending(exception) exception.with_duration(@timer.duration) end
def skip
def skip skipped end
def skipped
def skipped Result::Skipped.new end