Module: TestTube
- Defined in:
- lib/test_tube.rb,
lib/test_tube/passer.rb,
lib/test_tube/invoker.rb,
lib/test_tube/experiment.rb
Overview
Namespace for the TestTube library. This library provides two main methods for conducting software experiments:
-
invoke: For testing blocks of code, with full exception handling
-
pass: For testing direct values, with a simpler and safer approach
Defined Under Namespace
Classes: Experiment, Invoker, Passer
Class Method Summary collapse
-
.invoke ⇒ TestTube::Invoker
Invokes a block for testing.
-
.pass ⇒ TestTube::Passer
Tests a value directly.
Class Method Details
.invoke ⇒ TestTube::Invoker
Invokes a block for testing. This method should be used when you need to:
-
Execute and test a block of code
-
Catch all possible exceptions (including SystemExit)
-
Handle potentially dangerous operations safely
51 52 53 |
# File 'lib/test_tube.rb', line 51 def self.invoke(...) Invoker.new(...) end |
.pass ⇒ TestTube::Passer
Tests a value directly. This method should be used when you:
-
Already have the value to test
-
Don’t need to execute potentially dangerous code
-
Want a simpler and more direct testing approach
82 83 84 |
# File 'lib/test_tube.rb', line 82 def self.pass(...) Passer.new(...) end |