From 86d9ff7fc53c7c3c20ddc559f521b6160336bfb9 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Thu, 4 Aug 2011 16:06:28 -0400 Subject: [PATCH] trap errors better --- lib/hydra/runner.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/hydra/runner.rb b/lib/hydra/runner.rb index 733d95f..397f068 100644 --- a/lib/hydra/runner.rb +++ b/lib/hydra/runner.rb @@ -159,7 +159,11 @@ module Hydra #:nodoc: RSpec.instance_variable_set(:@world, nil) RSpec.instance_variable_set(:@configuration, nil) - result = RSpec::Core::Runner.run(config, hydra_output, hydra_output) + begin + result = RSpec::Core::Runner.run(config, hydra_output, hydra_output) + rescue ex + return ex.to_s + end hydra_output.rewind return (result == 1) ? hydra_output.read : ""