Sha256: 22f1436d9daba0f8ecec24323d47d1371bbf974ff2a7e0910f1b7f6114d26dd8

Contents?: true

Size: 218 Bytes

Versions: 11

Compression:

Stored size: 218 Bytes

Contents

require "stringio"

module CapturesStderr

  def capture_stderr
    orig_stderr = $stderr
    $stderr = StringIO.new
    begin
      yield
      $stderr.string
    ensure
      $stderr = orig_stderr
    end
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
cute_print-1.1.4 test_support/captures_stderr.rb
cute_print-1.1.3 test_support/captures_stderr.rb
cute_print-1.1.2 test_support/captures_stderr.rb
cute_print-1.1.1 test_support/captures_stderr.rb
cute_print-1.1.0 test_support/captures_stderr.rb
cute_print-1.0.1 test_support/captures_stderr.rb
cute_print-1.0.0 test_support/captures_stderr.rb
cute_print-0.4.0 test_support/captures_stderr.rb
cute_print-0.3.0 test_support/captures_stderr.rb
cute_print-0.2.0 test_support/captures_stderr.rb
cute_print-0.1.0 test_support/captures_stderr.rb