Module: Laborantin::Metaprog::Hookable

Included in:
Environment, Scenario
Defined in:
lib/laborantin/core/hookable.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#hooksObject

A hash to store setup/teardown hooks.



6
7
8
# File 'lib/laborantin/core/hookable.rb', line 6

def hooks
  @hooks
end

Instance Method Details

#setup(*args) ⇒ Object

Registers setup hooks.



9
10
11
# File 'lib/laborantin/core/hookable.rb', line 9

def setup(*args)
  hooks[:setup] = [*args].flatten
end

#teardown(*args) ⇒ Object

Register teardown hooks.



14
15
16
# File 'lib/laborantin/core/hookable.rb', line 14

def teardown(*args)
  hooks[:teardown] = [*args].flatten
end