Sha256: 81ffd18bb45ae1af5e8cb7eb45761a4717378de0e4d34da7af9f5e851ff100d8

Contents?: true

Size: 218 Bytes

Versions: 11

Compression:

Stored size: 218 Bytes

Contents

require "stringio"

module CapturesStdout

  def capture_stdout
    orig_stdout = $stdout
    $stdout = StringIO.new
    begin
      yield
      $stdout.string
    ensure
      $stdout = orig_stdout
    end
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

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