Sha256: a004ef5eb797d2b276377a127f91b5fe1945b44bc95c765be16fa7e71a5a6a12
Contents?: true
Size: 497 Bytes
Versions: 9
Compression:
Stored size: 497 Bytes
Contents
require 'rspec/support/spec' describe 'isolating a spec from the stderr splitter' do include RSpec::Support::WithIsolatedStdErr it 'allows a spec to output a warning' do with_isolated_stderr do $stderr.puts "Imma gonna warn you" end end it 'resets $stderr to its original value even if an error is raised' do orig_stderr = $stderr expect { with_isolated_stderr { raise "boom" } }.to raise_error("boom") expect($stderr).to be(orig_stderr) end end
Version data entries
9 entries across 9 versions & 2 rubygems