From e365c089407195fadc25b52531740e1ef9769805 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Thu, 4 Aug 2011 18:01:29 -0400 Subject: [PATCH] rspec messages working now --- lib/hydra/runner.rb | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/hydra/runner.rb b/lib/hydra/runner.rb index c2b35f2..1372a12 100644 --- a/lib/hydra/runner.rb +++ b/lib/hydra/runner.rb @@ -153,19 +153,20 @@ module Hydra #:nodoc: rescue LoadError => ex return ex.to_s end - hydra_output = StringIO.new + @hydra_output ||= StringIO.new + @hydra_output.rewind + @hydra_output.truncate(0) - config = [ '-f', 'progress', file ] - - RSpec.world.reset + config = [ file ] + RSpec.reset begin - result = RSpec::Core::Runner.run(config, hydra_output, hydra_output) + result = RSpec::Core::Runner.run(config, $stdout, @hydra_output) rescue Exception => ex return ex.to_s + "\n" + ex.backtrace.join("\n") end - hydra_output.rewind + @hydra_output.rewind - return (result == 1) ? hydra_output.read : "" + return (result == 1) ? @hydra_output.read : "" end # run all the scenarios in a cucumber feature file