Class: Mutant::Killer::Forked
- Inherits:
-
Mutant::Killer
- Object
- Mutant::Killer
- Mutant::Killer::Forked
- Defined in:
- lib/mutant/killer/forking.rb
Instance Attribute Summary
Attributes inherited from Mutant::Killer
#mutation, #runtime, #strategy
Instance Method Summary collapse
-
#initialize(killer, strategy, mutation) ⇒ Forked
constructor
A new instance of Forked.
- #run ⇒ Object
- #type ⇒ Object
Methods inherited from Mutant::Killer
#fail?, #identification, #mutation_source, #original_source, type
Constructor Details
#initialize(killer, strategy, mutation) ⇒ Forked
Returns a new instance of Forked.
5 6 7 8 |
# File 'lib/mutant/killer/forking.rb', line 5 def initialize(killer, strategy, mutation) @killer = killer super(strategy, mutation) end |
Instance Method Details
#run ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/mutant/killer/forking.rb', line 14 def run fork do killer = @killer.new(strategy, mutation) Kernel.exit(killer.fail? ? 1 : 0) end status = Process.wait2.last status.exitstatus.zero? end |
#type ⇒ Object
10 11 12 |
# File 'lib/mutant/killer/forking.rb', line 10 def type @killer.type end |