Module: Section9::UnitTest::TestCaseHelper

Defined in:
lib/section9/unittest.rb

Overview

testcase helper

Instance Method Summary collapse

Instance Method Details

#at_end(&block) ⇒ Object



425
426
427
# File 'lib/section9/unittest.rb', line 425

def at_end(&block)
  (@_at_end_callbacks ||= []) << block
end

#recorderObject



429
430
431
432
# File 'lib/section9/unittest.rb', line 429

def recorder
  require 'section9/recorder' unless defined?(Section9::Recorder)
  return Section9::Recorder.new
end

#teardownObject



415
416
417
418
419
# File 'lib/section9/unittest.rb', line 415

def teardown
  super
  @_tmp.revert if @_tmp
  @_at_end_callbacks.each {|block| block.call }.clear if @_at_end_callbacks
end

#tmpObject



421
422
423
# File 'lib/section9/unittest.rb', line 421

def tmp
  return @_tmp ||= Section9::Tmp.new
end