Module: Evilution
- Defined in:
- lib/evilution.rb,
lib/evilution/version.rb
Defined Under Namespace
Modules: AST, ChildOutput, Compare, Equivalent, Feedback, GemDetector, Git, Integration, Isolation, LoadPath, MCP, Memory, Mutator, Parallel, ParallelDbWarning, ProcessCleanup, RailsDetector, Reporter, Result, Session, TempDirTracker Classes: Baseline, CLI, Cache, Config, ConfigError, DisableComment, Error, ExampleFilter, Hooks, IsolationError, Mutation, ParseError, RelatedSpecHeuristic, Runner, SourceAstCache, SpecAstCache, SpecResolver, SpecSelector, Subject
Constant Summary collapse
- PROJECT_ROOT =
Captured at load time, before any isolator can chdir into a per-mutation sandbox. Used as the anchor for resolving project-relative paths (spec files, source files for eval) from inside a chdir’d child so the CWD sandbox (EV-wqxu / GH #1278) cannot break spec resolution or eval __FILE__.
Dir.pwd.freeze
- VERSION =
"0.31.0"
Class Method Summary collapse
-
.in_isolated_worker! ⇒ Object
Flag set by isolators (Evilution::Isolation::Fork in the forked child, Evilution::Isolation::InProcess around the test_command) so spec resolution and source eval anchor relative paths to PROJECT_ROOT instead of Dir.pwd.
- .in_isolated_worker? ⇒ Boolean
- .with_isolated_worker ⇒ Object
Class Method Details
.in_isolated_worker! ⇒ Object
Flag set by isolators (Evilution::Isolation::Fork in the forked child, Evilution::Isolation::InProcess around the test_command) so spec resolution and source eval anchor relative paths to PROJECT_ROOT instead of Dir.pwd. Without this gate, a caller that intentionally chdirs to a different project (e.g. a fixture layout in tests) would have its lookups inadvertently fall back to the evilution dev tree.
144 145 146 |
# File 'lib/evilution.rb', line 144 def self.in_isolated_worker! @in_isolated_worker = true end |
.in_isolated_worker? ⇒ Boolean
148 149 150 |
# File 'lib/evilution.rb', line 148 def self.in_isolated_worker? @in_isolated_worker == true end |
.with_isolated_worker ⇒ Object
152 153 154 155 156 157 158 |
# File 'lib/evilution.rb', line 152 def self.with_isolated_worker previous = @in_isolated_worker @in_isolated_worker = true yield ensure @in_isolated_worker = previous end |