123456789_123456789_123456789_123456789_123456789_

Class: RSpec::Matchers::BuiltIn::CaptureStdout Private

Do not use. This class is for internal use only.
Relationships & Source Files
Inherits: Object
Defined in: rspec-expectations/lib/rspec/matchers/built_in/output.rb

Instance Attribute Summary

Instance Method Summary

Instance Attribute Details

#as_tty (rw)

[ GitHub ]

  
# File 'rspec-expectations/lib/rspec/matchers/built_in/output.rb', line 171

attr_accessor :as_tty

Instance Method Details

#capture(block)

[ GitHub ]

  
# File 'rspec-expectations/lib/rspec/matchers/built_in/output.rb', line 177

def capture(block)
  captured_stream = CapturedStream.new
  captured_stream.as_tty = as_tty

  original_stream = $stdout
  $stdout = captured_stream

  block.call

  captured_stream.string
ensure
  $stdout = original_stream
end

#name

[ GitHub ]

  
# File 'rspec-expectations/lib/rspec/matchers/built_in/output.rb', line 173

def name
  'stdout'
end