class Cucumber::Core::Test::AroundHook

Public Class Methods

new(&block) click to toggle source
# File lib/cucumber/core/test/around_hook.rb, line 5
def initialize(&block)
  @block = block
  @timer = Timer.new
end

Public Instance Methods

describe_to(visitor, *args, &continue) click to toggle source
# File lib/cucumber/core/test/around_hook.rb, line 10
def describe_to(visitor, *args, &continue)
  visitor.around_hook(self, *args, &continue)
end
execute(*args, &continue) click to toggle source
# File lib/cucumber/core/test/around_hook.rb, line 14
def execute(*args, &continue)
  @timer.start
  @block.call(continue)
  Result::Unknown.new # Around hook does not know the result of the inner test steps
rescue Result::Raisable => exception
  exception.with_duration(@timer.duration)
rescue Exception => exception
  failed(exception)
end

Private Instance Methods

failed(exception) click to toggle source
# File lib/cucumber/core/test/around_hook.rb, line 25
def failed(exception)
  Result::Failed.new(@timer.duration, exception)
end