Module: TestStartupAndShutdown

Defined in:
lib/test_startup.rb

Defined Under Namespace

Modules: TestSuiteWithGlobalStartup

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#__shutdown_blocksObject (readonly)

Returns the value of attribute __shutdown_blocks.



18
19
20
# File 'lib/test_startup.rb', line 18

def __shutdown_blocks
  @__shutdown_blocks
end

#__startup_blocksObject (readonly)

Returns the value of attribute __startup_blocks.



18
19
20
# File 'lib/test_startup.rb', line 18

def __startup_blocks
  @__startup_blocks
end

Instance Method Details

#install_global_startupObject



20
21
22
# File 'lib/test_startup.rb', line 20

def install_global_startup
  extend(TestSuiteWithGlobalStartup)
end

#shutdown(&block) ⇒ Object



11
12
13
14
15
16
# File 'lib/test_startup.rb', line 11

def shutdown(&block)
  install_global_startup
  @__shutdown_blocks ||= []
  @__shutdown_blocks << block if block_given?
  @__shutdown_blocks
end

#startup(&block) ⇒ Object



4
5
6
7
8
9
# File 'lib/test_startup.rb', line 4

def startup(&block)
  install_global_startup
  @__startup_blocks ||= []
  @__startup_blocks << block if block_given?
  @__startup_blocks
end