class Cucumber::Core::Test::Action::Defined
def execute(*args)
def execute(*args) @timer.start @block.call(*args) passed rescue Result::Raisable => e e.with_duration(@timer.duration) rescue Exception => e failed(e) end
def failed(exception)
def failed(exception) Result::Failed.new(@timer.duration, exception) end
def initialize(location = nil, &block)
def initialize(location = nil, &block) raise ArgumentError, 'Passing a block to execute the action is mandatory.' unless block @location = location || Test::Location.new(*block.source_location) @block = block @timer = Timer.new end
def inspect
def inspect "#<#{self.class}: #{location}>" end
def passed
def passed Result::Passed.new(@timer.duration) end
def skip(*)
def skip(*) skipped end
def skipped
def skipped Result::Skipped.new end