Top Level Namespace

Defined Under Namespace

Modules: TMail Classes: Array, DBC, Hash, Object, String, Time

Instance Method Summary collapse

Instance Method Details

#capture_stderrObject



1
2
3
4
5
6
7
8
9
10
11
12
# File 'lib/tworgy/testing.rb', line 1

def capture_stderr
  result = ""
  begin
    $stderr = StringIO.new 
    yield
    $stderr.rewind
    result = $stderr.read
  ensure 
    $stderr = STDERR
  end
  result
end