Class: TestProf::BeforeAll::HooksChain

Inherits:
Object
  • Object
show all
Defined in:
lib/test_prof/before_all.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type) ⇒ HooksChain

Returns a new instance of HooksChain.



82
83
84
85
86
# File 'lib/test_prof/before_all.rb', line 82

def initialize(type)
  @type = type
  @before = []
  @after = []
end

Instance Attribute Details

#afterObject (readonly)

Returns the value of attribute after.



80
81
82
# File 'lib/test_prof/before_all.rb', line 80

def after
  @after
end

#beforeObject (readonly)

Returns the value of attribute before.



80
81
82
# File 'lib/test_prof/before_all.rb', line 80

def before
  @before
end

#typeObject (readonly)

Returns the value of attribute type.



80
81
82
# File 'lib/test_prof/before_all.rb', line 80

def type
  @type
end

Instance Method Details

#run(scope = nil, metadata = []) ⇒ Object



88
89
90
91
92
# File 'lib/test_prof/before_all.rb', line 88

def run(scope = nil,  = [])
  before.each { |hook| hook.run(scope, ) }
  yield
  after.each { |hook| hook.run(scope, ) }
end