Class: Test::Unit::TestCase

Inherits:
Object
  • Object
show all
Defined in:
lib/test_extensions/remove_constants_when_test_suite_finished.rb,
lib/test_extensions/fresh_test_environment_creator.rb,
lib/test_extensions/runnable.rb

Class Method Summary collapse

Class Method Details

.run!Object

Just a (much conciser) wrapper for Test::Unit::UI::Console::TestRunner.run(NameOfTestCase)



19
20
21
22
23
24
25
# File 'lib/test_extensions/runnable.rb', line 19

def self.run!
  Test::Unit::UI::Console::TestRunner.run(self)

  self.ignore_access.class_variable_get(:@@classes_to_remove).each do |class_to_reload|
    class_to_reload.remove_const! rescue nil
  end if self.ignore_access.class_variables.include?('@@classes_to_remove')
end

.run_with_remove_constants_when_test_suite_finished!Object



22
23
24
25
26
27
28
29
# File 'lib/test_extensions/remove_constants_when_test_suite_finished.rb', line 22

def self.run_with_remove_constants_when_test_suite_finished!
  run_without_remove_constants_when_test_suite_finished!

  self.ignore_access.class_variable_get(:@@classes_to_remove).each do |class_to_reload|
    #puts "removing #{class_to_reload}"
    class_to_reload.remove_const! rescue nil
  end if self.ignore_access.class_variables.include?('@@classes_to_remove')
end