class Cucumber::Core::Test::Action

def execute(*args)

def execute(*args)
  @timer.start
  @block.call(*args)
  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(location = nil, &block)

def initialize(location = nil, &block)
  raise ArgumentError, "Passing a block to execute the action is mandatory." unless block
  @location = location ? location : Test::Location.new(*block.source_location)
  @block = block
  @timer = Timer.new
end

def inspect

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

def location

def location
  @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