Class: Evilution::Runner::BaselineRunner Private
- Inherits:
-
Object
- Object
- Evilution::Runner::BaselineRunner
- Defined in:
- lib/evilution/runner/baseline_runner.rb
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.
Instance Method Summary collapse
- #base_integration_kwargs ⇒ Object private
- #build_integration ⇒ Object private
- #call(subjects) ⇒ Object private
-
#initialize(config, hooks: nil) ⇒ BaselineRunner
constructor
private
A new instance of BaselineRunner.
- #integration_class ⇒ Object private
- #neutralization_fallback_dir ⇒ Object private
- #neutralization_resolver ⇒ Object private
- #rspec_integration_kwargs ⇒ Object private
Constructor Details
#initialize(config, hooks: nil) ⇒ BaselineRunner
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.
Returns a new instance of BaselineRunner.
25 26 27 28 |
# File 'lib/evilution/runner/baseline_runner.rb', line 25 def initialize(config, hooks: nil) @config = config @hooks = hooks end |
Instance Method Details
#base_integration_kwargs ⇒ 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.
43 44 45 46 47 48 49 50 |
# File 'lib/evilution/runner/baseline_runner.rb', line 43 def base_integration_kwargs { test_files: config.spec_files.empty? ? nil : config.spec_files, hooks: hooks, fallback_to_full_suite: config.fallback_to_full_suite?, spec_selector: config.spec_selector } end |
#build_integration ⇒ 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.
36 37 38 39 40 41 |
# File 'lib/evilution/runner/baseline_runner.rb', line 36 def build_integration klass = integration_class kwargs = base_integration_kwargs kwargs.merge!(rspec_integration_kwargs) if klass == Evilution::Integration::RSpec klass.new(**kwargs) end |
#call(subjects) ⇒ 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.
59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/evilution/runner/baseline_runner.rb', line 59 def call(subjects) return nil unless config.baseline? && subjects.any? log_start baseline = Evilution::Baseline.new( timeout: config.timeout, test_files: config.spec_files.empty? ? nil : config.spec_files, **integration_class. ) result = baseline.call(subjects) log_complete(result) result end |
#integration_class ⇒ 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.
30 31 32 33 34 |
# File 'lib/evilution/runner/baseline_runner.rb', line 30 def integration_class @integration_class ||= Evilution::Runner::INTEGRATIONS.fetch(config.integration) do raise Evilution::Error, "unknown integration: #{config.integration}" end end |
#neutralization_fallback_dir ⇒ 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.
77 78 79 |
# File 'lib/evilution/runner/baseline_runner.rb', line 77 def neutralization_fallback_dir integration_class.[:fallback_dir] || "spec" end |
#neutralization_resolver ⇒ 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.
73 74 75 |
# File 'lib/evilution/runner/baseline_runner.rb', line 73 def neutralization_resolver integration_class.[:spec_resolver] || Evilution::SpecResolver.new end |
#rspec_integration_kwargs ⇒ 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.
52 53 54 55 56 57 |
# File 'lib/evilution/runner/baseline_runner.rb', line 52 def rspec_integration_kwargs { related_specs_heuristic: config., example_filter: build_example_filter } end |