Class: Fix::Run Private
- Inherits:
-
Object
- Object
- Fix::Run
- Defined in:
- lib/fix/run.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.
Executes a test specification by running a subject against a set of challenges and requirements.
The Run class orchestrates test execution by:
-
Evaluating the test subject in the proper environment
-
Applying a series of method challenges to the result
-
Verifying the final value against the requirement
Instance Attribute Summary collapse
-
#challenges ⇒ Array<::Defi::Method>
readonly
private
The list of method calls to apply to the subject.
-
#environment ⇒ ::Fix::Dsl
readonly
private
The test environment containing defined variables and methods.
-
#requirement ⇒ ::Spectus::Requirement::Base
readonly
private
The specification requirement to validate against.
Instance Method Summary collapse
-
#initialize(environment, requirement, *challenges) ⇒ Run
constructor
private
Initializes a new test run with the given environment and challenges.
-
#test(&subject) ⇒ ::Expresenter::Pass
private
Verifies if the subject meets the requirement after applying all challenges.
Constructor Details
#initialize(environment, requirement, *challenges) ⇒ Run
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.
Initializes a new test run with the given environment and challenges.
44 45 46 47 48 |
# File 'lib/fix/run.rb', line 44 def initialize(environment, requirement, *challenges) @environment = environment @requirement = requirement @challenges = challenges end |
Instance Attribute Details
#challenges ⇒ Array<::Defi::Method> (readonly)
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.
The list of method calls to apply to the subject
34 35 36 |
# File 'lib/fix/run.rb', line 34 def challenges @challenges end |
#environment ⇒ ::Fix::Dsl (readonly)
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.
The test environment containing defined variables and methods
26 27 28 |
# File 'lib/fix/run.rb', line 26 def environment @environment end |
#requirement ⇒ ::Spectus::Requirement::Base (readonly)
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.
The specification requirement to validate against
30 31 32 |
# File 'lib/fix/run.rb', line 30 def requirement @requirement end |
Instance Method Details
#test(&subject) ⇒ ::Expresenter::Pass
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.
Verifies if the subject meets the requirement after applying all challenges.
64 65 66 67 68 |
# File 'lib/fix/run.rb', line 64 def test(&subject) requirement.call { actual_value(&subject) } rescue ::Expresenter::Fail => e e end |