Class: Mutant::Strategy
- Inherits:
-
Object
- Object
- Mutant::Strategy
- Includes:
- AbstractType, Adamantium::Flat
- Defined in:
- lib/mutant/strategy.rb
Overview
Abstract base class for killing strategies
Direct Known Subclasses
Defined Under Namespace
Classes: Null
Constant Summary collapse
- REGISTRY =
{}
Class Method Summary collapse
-
.lookup(name) ⇒ Strategy
private
Lookup strategy for name.
Instance Method Summary collapse
-
#all_tests ⇒ Enumerable<Test>
private
Return all available tests by strategy.
-
#setup ⇒ self
private
Perform strategy setup.
-
#teardown ⇒ self
private
Perform strategy teardown.
-
#tests(subject) ⇒ Enumerable<Test>
private
Return tests for mutation.
Class Method Details
Instance Method Details
#all_tests ⇒ Enumerable<Test>
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.
Return all available tests by strategy
63 |
# File 'lib/mutant/strategy.rb', line 63 abstract_method :all_tests |
#setup ⇒ self
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.
Perform strategy setup
43 44 45 |
# File 'lib/mutant/strategy.rb', line 43 def setup self end |
#teardown ⇒ self
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.
Perform strategy teardown
53 54 55 |
# File 'lib/mutant/strategy.rb', line 53 def teardown self end |
#tests(subject) ⇒ Enumerable<Test>
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.
Return tests for mutation
TODO: This logic is now centralized but still fucked.
75 76 77 78 79 80 81 82 83 84 |
# File 'lib/mutant/strategy.rb', line 75 def tests(subject) subject.match_prefixes.map do |match_expression| tests = all_tests.select do |test| test.subject_identification.start_with?(match_expression) end return tests if tests.any? end EMPTY_ARRAY end |