Class: Evilution::Integration::TestUnit::FrameworkLoader Private
- Inherits:
-
Object
- Object
- Evilution::Integration::TestUnit::FrameworkLoader
- Defined in:
- lib/evilution/integration/test_unit/framework_loader.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Loads the test-unit gem and disables its at_exit auto-run handler. Mirrors Evilution::Integration::RSpec::FrameworkLoader's role: framework setup is one responsibility separated from dispatch + result building so integrations can compose it independently in tests.
Class Method Summary collapse
-
.stub_autorun! ⇒ Object
private
User code that
require "test-unit"installs an at_exit hook that calls Test::Unit::AutoRunner.run when need_auto_run? is true.
Instance Method Summary collapse
- #call ⇒ Object private
- #loaded? ⇒ Boolean private
Class Method Details
.stub_autorun! ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
User code that require "test-unit" installs an at_exit hook that calls
Test::Unit::AutoRunner.run when need_auto_run? is true. At evilution exit
ARGV still holds evilution flags and the runner prints a misleading banner.
Flipping need_auto_run = false prevents the handler from firing.
28 29 30 31 32 |
# File 'lib/evilution/integration/test_unit/framework_loader.rb', line 28 def self.stub_autorun! return unless defined?(::Test::Unit::AutoRunner) ::Test::Unit::AutoRunner.need_auto_run = false end |
Instance Method Details
#call ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
14 15 16 17 18 19 20 21 22 |
# File 'lib/evilution/integration/test_unit/framework_loader.rb', line 14 def call return if @loaded require "test-unit" self.class.stub_autorun! @loaded = true rescue LoadError => e raise Evilution::Error, "test-unit is required but not available: #{e.}" end |
#loaded? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 |
# File 'lib/evilution/integration/test_unit/framework_loader.rb', line 10 def loaded? @loaded == true end |