Class: AllureRSpec::Hooks::OverrideHooksMethods::OverridenHookCollections

Inherits:
RSpec::Core::Hooks::HookCollections
  • Object
show all
Defined in:
lib/allure-rspec/hooks.rb

Instance Method Summary collapse

Constructor Details

#initialize(original) ⇒ OverridenHookCollections

Returns a new instance of OverridenHookCollections.



20
21
22
23
24
25
26
27
# File 'lib/allure-rspec/hooks.rb', line 20

def initialize(original)
  super(original.instance_eval("@owner"), original.instance_eval("@filterable_item_repo_class"))
  [:@before_example_hooks, :@after_example_hooks, :@before_context_hooks, :@after_context_hooks, :@around_example_hooks].each { |var|
    instance_variable_set(var, original.instance_eval("#{var}"))
  }
  @before_step_hooks = nil
  @after_step_hooks = nil
end

Instance Method Details

#run(position, scope, example_or_group) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/allure-rspec/hooks.rb', line 29

def run(position, scope, example_or_group)
  if scope == :step
    run_owned_hooks_for(position, scope, example_or_group)
  else
    super
  end
end