Class: Evilution::Runner::IsolationResolver
- Inherits:
-
Object
- Object
- Evilution::Runner::IsolationResolver
- Defined in:
- lib/evilution/runner/isolation_resolver.rb
Constant Summary collapse
- PRELOAD_CANDIDATES =
[ File.join("spec", "rails_helper.rb"), File.join("test", "test_helper.rb") ].freeze
Instance Method Summary collapse
-
#initialize(config, target_files:, hooks:) ⇒ IsolationResolver
constructor
A new instance of IsolationResolver.
- #isolator ⇒ Object
- #perform_preload ⇒ Object
- #rails_root_detected? ⇒ Boolean
Constructor Details
#initialize(config, target_files:, hooks:) ⇒ IsolationResolver
Returns a new instance of IsolationResolver.
15 16 17 18 19 |
# File 'lib/evilution/runner/isolation_resolver.rb', line 15 def initialize(config, target_files:, hooks:) @config = config @target_files_callback = target_files @hooks = hooks end |
Instance Method Details
#isolator ⇒ Object
21 22 23 |
# File 'lib/evilution/runner/isolation_resolver.rb', line 21 def isolator @isolator ||= build_isolator end |
#perform_preload ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/evilution/runner/isolation_resolver.rb', line 31 def perform_preload return if config.preload == false return unless resolve_isolation == :fork path = resolve_preload_path return unless path prepare_load_path_for_preload require File.(path) rescue ScriptError, StandardError => e raise Evilution::ConfigError.new( "failed to preload #{path.inspect}: #{e.class}: #{e.}", file: path ) end |
#rails_root_detected? ⇒ Boolean
25 26 27 28 29 |
# File 'lib/evilution/runner/isolation_resolver.rb', line 25 def rails_root_detected? return @rails_root_detected if defined?(@rails_root_detected) @rails_root_detected = !detected_rails_root.nil? end |