class Cucumber::Core::Test::Action

def execute(last_result)

def execute(last_result)
  @timer.start
  @block.call(last_result)
  passed
rescue Result::Raisable => exception
  exception.with_duration(@timer.duration)
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 inspect

def inspect
  "<#{self.class}: #{location}>"
end

def location

def location
  Ast::Location.new(*@block.source_location)
end

def passed

def passed
  Result::Passed.new(@timer.duration)
end

def skip(last_result)

def skip(last_result)
  skipped
end

def skipped

def skipped
  Result::Skipped.new
end