Class: TestTube::Passer Private
- Inherits:
-
Experiment
- Object
- Experiment
- TestTube::Passer
- Defined in:
- lib/test_tube/passer.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.
Evaluate an actual value passed in parameter. Unlike Invoker, this class handles direct value testing without executing a block, making it safer when you already have the value to test.
Instance Attribute Summary
Attributes inherited from Experiment
Instance Method Summary collapse
-
#initialize(input, matcher:, negate:) ⇒ Passer
constructor
private
Class initializer.
Methods inherited from Experiment
Constructor Details
#initialize(input, matcher:, negate:) ⇒ Passer
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.
Class initializer. Validates the matcher and negate parameter before performing the test. Since no code block is executed, this approach is immune to system-level exceptions that might occur during value computation.
27 28 29 30 31 32 33 |
# File 'lib/test_tube/passer.rb', line 27 def initialize(input, matcher:, negate:) validate_matcher(matcher) validate_negate(negate) super() @actual = input @got = negate ^ matcher.match? { input } end |