trap errors better

This commit is contained in:
John Bintz 2011-08-04 16:06:28 -04:00
parent c8ade6557e
commit 86d9ff7fc5
1 changed files with 5 additions and 1 deletions

View File

@ -159,7 +159,11 @@ module Hydra #:nodoc:
RSpec.instance_variable_set(:@world, nil) RSpec.instance_variable_set(:@world, nil)
RSpec.instance_variable_set(:@configuration, 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 hydra_output.rewind
return (result == 1) ? hydra_output.read : "" return (result == 1) ? hydra_output.read : ""