module RSpec::Matchers::BuiltIn::CaptureStderr

@private

Public Class Methods

capture(block) click to toggle source
# File lib/rspec/matchers/built_in/output.rb, line 157
def self.capture(block)
  captured_stream = StringIO.new

  original_stream = $stderr
  $stderr = captured_stream

  block.call

  captured_stream.string
ensure
  $stderr = original_stream
end
name() click to toggle source
# File lib/rspec/matchers/built_in/output.rb, line 153
def self.name
  'stderr'
end