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 18 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
hook?()
click to toggle source
# File lib/cucumber/core/test/around_hook.rb, line 14 def hook? true end
Private Instance Methods
failed(exception)
click to toggle source
# File lib/cucumber/core/test/around_hook.rb, line 29 def failed(exception) Result::Failed.new(@timer.duration, exception) end