Sha256: a55fcc70d2366822720c510c98feeac60e7b5f7ec15207402b669fbf5236ff20

Contents?: true

Size: 287 Bytes

Versions: 24

Compression:

Stored size: 287 Bytes

Contents

# coding: utf-8
module CaptureStd
  def capture_stderr
    err, $stderr = $stderr, StringIO.new
    yield
    $stderr.string
  ensure
    $stderr = err
  end

  def capture_stdout
    out, $stdout = $stdout, StringIO.new
    yield
    $stdout.string
  ensure
    $stdout = out
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
i18n-tasks-0.5.0 spec/support/capture_std.rb
i18n-tasks-0.4.5 spec/support/capture_std.rb
i18n-tasks-0.4.4 spec/support/capture_std.rb
i18n-tasks-0.4.3 spec/support/capture_std.rb