lib/fezzik/util.rb in fezzik-0.7.2 vs lib/fezzik/util.rb in fezzik-0.7.3
- old
+ new
@@ -1,13 +1,13 @@
module Fezzik
module Util
def self.capture_output(&block)
output = StringIO.new
- $stdout = output
+ Thread.current[:stdout] = output
block.call
- return output.string
+ output.string
ensure
- $stdout = STDOUT
+ Thread.current[:stdout] = STDOUT
end
def self.split_task_and_params(task_with_params)
params_match = /(.+)\[(.+)\]/.match(task_with_params)
if params_match