From c0fa278f196bb33f72711c2ca90f6acc63ac7e91 Mon Sep 17 00:00:00 2001 From: Markus Schirp Date: Sat, 5 Jan 2013 22:58:08 +0100 Subject: [PATCH] Count exception between mutation insertion and spec run as kill --- Changelog.md | 4 ++++ lib/mutant/killer/forking.rb | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Changelog.md b/Changelog.md index 04866a37..b1016d66 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,7 @@ +# v0.2.13 2013-01-05 + +* [fixed] Capture failures that occur in the window between mutation insertion and spec run as kills + # v0.2.12 2013-01-03 * [fixed] Do not crash when trying to load methods from precompiled ruby under rbx diff --git a/lib/mutant/killer/forking.rb b/lib/mutant/killer/forking.rb index 8836d99d..4fc864cf 100644 --- a/lib/mutant/killer/forking.rb +++ b/lib/mutant/killer/forking.rb @@ -41,8 +41,12 @@ module Mutant # def run fork do - killer = @killer.new(strategy, mutation) - Kernel.exit(killer.fail? ? 1 : 0) + begin + killer = @killer.new(strategy, mutation) + Kernel.exit(killer.fail? ? 1 : 0) + rescue + Kernel.exit(1) + end end status = Process.wait2.last