Module: TestStartupAndShutdown::TestSuiteWithGlobalStartup

Defined in:
lib/test_startup.rb

Instance Method Summary collapse

Instance Method Details

#suite(*args) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/test_startup.rb', line 25

def suite(*args)
  mysuite = super
  these_startup_blocks = __startup_blocks
  these_shutdown_blocks = __shutdown_blocks
  mysuite.instance_eval { @__startup_blocks = these_startup_blocks }
  mysuite.instance_eval { @__shutdown_blocks = these_shutdown_blocks }
  def mysuite.run(*args)
    @__startup_blocks.each { |block| block.call }
    super
    @__shutdown_blocks.each { |block| block.call }
  end
  mysuite
end