123456789_123456789_123456789_123456789_123456789_

Class: RSpec::Matchers::BuiltIn::CaptureStderr 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 194

attr_accessor :as_tty

Instance Method Details

#capture(block)

[ GitHub ]

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

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

  original_stream = $stderr
  $stderr = captured_stream

  block.call

  captured_stream.string
ensure
  $stderr = original_stream
end

#name

[ GitHub ]

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

def name
  'stderr'
end