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
- #as_tty rw Internal use only
Instance Method Summary
- #capture(block) Internal use only
- #name Internal use only
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