Module: Fezzik::Util

Defined in:
lib/fezzik/util.rb

Class Method Summary collapse

Class Method Details

.capture_output(&block) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/fezzik/util.rb', line 3

def self.capture_output(&block)
  warn "WARN [Fezzik]: Fezzik::Util.capture_output is deprecated as of 0.8.0," +
       " use `run \"...\", :output => capture` instead"
  output = StringIO.new
  $stdout = output
  block.call
  output.string
ensure
  $stdout = STDOUT
end