Sha256: b3a59dc27b852cfb13e2b69252454679be21a2adc25899e03362c352a0959351

Contents?: true

Size: 270 Bytes

Versions: 71

Compression:

Stored size: 270 Bytes

Contents

require 'stringio'

def capture_stdout(&blk)
  old = $stdout
  $stdout = fake = StringIO.new
  blk.call
  fake.string
ensure
  $stdout = old
end

def capture_stderr(&blk)
  old = $stderr
  $stderr = fake = StringIO.new
  blk.call
  fake.string
ensure
  $stderr = old
end

Version data entries

71 entries across 71 versions & 1 rubygems

Version Path
ayadn-1.8.1 spec/helpers.rb
ayadn-1.8.0 spec/helpers.rb
ayadn-1.7.7 spec/helpers.rb
ayadn-1.7.6 spec/helpers.rb
ayadn-1.7.5 spec/helpers.rb
ayadn-1.7.4 spec/helpers.rb
ayadn-1.7.3 spec/helpers.rb
ayadn-1.7.2 spec/helpers.rb
ayadn-1.7.1 spec/helpers.rb
ayadn-1.7.0 spec/helpers.rb
ayadn-1.6.0 spec/helpers.rb
ayadn-1.5.1 spec/helpers.rb
ayadn-1.5.0 spec/helpers.rb
ayadn-1.4.6 spec/helpers.rb
ayadn-1.4.5 spec/helpers.rb
ayadn-1.4.4 spec/helpers.rb
ayadn-1.4.3 spec/helpers.rb
ayadn-1.4.2 spec/helpers.rb
ayadn-1.4.1 spec/helpers.rb
ayadn-1.4.0 spec/helpers.rb