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.3.2 spec/helpers.rb
ayadn-1.3.1 spec/helpers.rb
ayadn-1.3.0 spec/helpers.rb
ayadn-1.2.10 spec/helpers.rb
ayadn-1.2.9 spec/helpers.rb
ayadn-1.2.8 spec/helpers.rb
ayadn-1.2.7 spec/helpers.rb
ayadn-1.2.6 spec/helpers.rb
ayadn-1.2.5 spec/helpers.rb
ayadn-1.2.4 spec/helpers.rb
ayadn-1.2.3 spec/helpers.rb
ayadn-1.2.2 spec/helpers.rb
ayadn-1.2.1 spec/helpers.rb
ayadn-1.2.0 spec/helpers.rb
ayadn-1.1.3 spec/helpers.rb
ayadn-1.1.1 spec/helpers.rb
ayadn-1.1.0 spec/helpers.rb
ayadn-1.0.13 spec/helpers.rb
ayadn-1.0.12 spec/helpers.rb
ayadn-1.0.11 spec/helpers.rb