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.7.11 spec/support/capture_std.rb
i18n-tasks-0.7.10 spec/support/capture_std.rb
i18n-tasks-0.7.9 spec/support/capture_std.rb
i18n-tasks-0.7.8 spec/support/capture_std.rb
i18n-tasks-0.7.7 spec/support/capture_std.rb
i18n-tasks-0.7.6 spec/support/capture_std.rb
i18n-tasks-0.7.5 spec/support/capture_std.rb
i18n-tasks-0.7.4 spec/support/capture_std.rb
i18n-tasks-0.7.3 spec/support/capture_std.rb
i18n-tasks-0.7.2 spec/support/capture_std.rb
i18n-tasks-0.7.1 spec/support/capture_std.rb
i18n-tasks-0.7.0 spec/support/capture_std.rb
i18n-tasks-0.6.3 spec/support/capture_std.rb
i18n-tasks-0.6.2 spec/support/capture_std.rb
i18n-tasks-0.6.1 spec/support/capture_std.rb
i18n-tasks-0.6.0 spec/support/capture_std.rb
i18n-tasks-0.5.4 spec/support/capture_std.rb
i18n-tasks-0.5.3 spec/support/capture_std.rb
i18n-tasks-0.5.2 spec/support/capture_std.rb
i18n-tasks-0.5.1 spec/support/capture_std.rb