Sha256: cf7cae8f97f6b6fe7ea5a24bc528f85297fdd77400265b836a59dabaa6f6fc8e

Contents?: true

Size: 287 Bytes

Versions: 2

Compression:

Stored size: 287 Bytes

Contents

$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'stroop'

def capture(stream)
  begin
    stream = stream.to_s
    eval "$#{stream} = StringIO.new"
    yield
    result = eval("$#{stream}").string
  ensure
    eval("$#{stream} = #{stream.upcase}")
  end

  result
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
stroop-1.2.0 spec/spec_helper.rb
stroop-1.1.0 spec/spec_helper.rb