Sha256: f8eb98fa89cbefb1bb8819a300bd793fb1db5600f23ca12a08ab1514d34dd81c

Contents?: true

Size: 305 Bytes

Versions: 2

Compression:

Stored size: 305 Bytes

Contents

# Captures output from `puts`
#   thanks @ Rob Olson
#   http://thinkingdigitally.com/archive/capturing-output-from-puts-in-ruby/

require 'stringio'
 
module Kernel
 
  def capture_stdout
    out = StringIO.new
    $stdout = out
    yield
      return out
    ensure
      $stdout = STDOUT
  end
   
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
autocuke-0.1.1 test/support/kernel.rb
autocuke-0.1.0 test/support/kernel.rb