module Cucumber::Hooks

def after_hook(id, location, &block)

def after_hook(id, location, &block)
  build_hook_step(id, location, block, AfterHook, Core::Test::UnskippableAction)
end

def after_step_hook(id, test_step, location, &block)

def after_step_hook(id, test_step, location, &block)
  raise ArgumentError if test_step.hook?
  build_hook_step(id, location, block, AfterStepHook, Core::Test::Action)
end

def around_hook(&block)

def around_hook(&block)
  Core::Test::AroundHook.new(&block)
end

def before_hook(id, location, &block)

def before_hook(id, location, &block)
  build_hook_step(id, location, block, BeforeHook, Core::Test::UnskippableAction)
end

def build_hook_step(id, location, block, hook_type, action_type)

def build_hook_step(id, location, block, hook_type, action_type)
  action = action_type.new(location, &block)
  hook = hook_type.new(action.location)
  Core::Test::HookStep.new(id, hook.text, location, action)
end