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-4.0.3 spec/helpers.rb
ayadn-4.0.2 spec/helpers.rb
ayadn-4.0.1 spec/helpers.rb
ayadn-4.0 spec/helpers.rb
ayadn-3.0 spec/helpers.rb
ayadn-2.1 spec/helpers.rb
ayadn-2.0.12 spec/helpers.rb
ayadn-2.0.11 spec/helpers.rb
ayadn-2.0.10 spec/helpers.rb
ayadn-2.0.9 spec/helpers.rb
ayadn-2.0.8 spec/helpers.rb
ayadn-2.0.7 spec/helpers.rb
ayadn-2.0.6 spec/helpers.rb
ayadn-2.0.5 spec/helpers.rb
ayadn-2.0.4 spec/helpers.rb
ayadn-2.0.3 spec/helpers.rb
ayadn-2.0.2 spec/helpers.rb
ayadn-2.0.1 spec/helpers.rb
ayadn-2.0 spec/helpers.rb
ayadn-1.8.2 spec/helpers.rb