rspec messages working now

This commit is contained in:
John Bintz 2011-08-04 18:01:29 -04:00
parent 890858e40b
commit e365c08940
1 changed files with 8 additions and 7 deletions

View File

@ -153,19 +153,20 @@ module Hydra #:nodoc:
rescue LoadError => ex rescue LoadError => ex
return ex.to_s return ex.to_s
end end
hydra_output = StringIO.new @hydra_output ||= StringIO.new
@hydra_output.rewind
@hydra_output.truncate(0)
config = [ '-f', 'progress', file ] config = [ file ]
RSpec.reset
RSpec.world.reset
begin begin
result = RSpec::Core::Runner.run(config, hydra_output, hydra_output) result = RSpec::Core::Runner.run(config, $stdout, @hydra_output)
rescue Exception => ex rescue Exception => ex
return ex.to_s + "\n" + ex.backtrace.join("\n") return ex.to_s + "\n" + ex.backtrace.join("\n")
end end
hydra_output.rewind @hydra_output.rewind
return (result == 1) ? hydra_output.read : "" return (result == 1) ? @hydra_output.read : ""
end end
# run all the scenarios in a cucumber feature file # run all the scenarios in a cucumber feature file