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.



53
54
55
56
57
# File 'lib/test_prof/before_all.rb', line 53

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

Instance Attribute Details

#afterObject (readonly)

Returns the value of attribute after.



51
52
53
# File 'lib/test_prof/before_all.rb', line 51

def after
  @after
end

#beforeObject (readonly)

Returns the value of attribute before.



51
52
53
# File 'lib/test_prof/before_all.rb', line 51

def before
  @before
end

#typeObject (readonly)

Returns the value of attribute type.



51
52
53
# File 'lib/test_prof/before_all.rb', line 51

def type
  @type
end

Instance Method Details

#runObject



59
60
61
62
63
# File 'lib/test_prof/before_all.rb', line 59

def run
  before.each(&:call)
  yield
  after.each(&:call)
end