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

Version Path
opal-rspec-0.6.2 rspec-support/spec/rspec/support/spec/with_isolated_std_err_spec.rb
opal-rspec-0.6.1 rspec-support/spec/rspec/support/spec/with_isolated_std_err_spec.rb
opal-rspec-0.6.0 rspec-support/spec/rspec/support/spec/with_isolated_std_err_spec.rb
opal-rspec-0.6.0.beta1 rspec-support/spec/rspec/support/spec/with_isolated_std_err_spec.rb
opal-connect-rspec-0.5.0 rspec-support/spec/rspec/support/spec/with_isolated_std_err_spec.rb
opal-rspec-0.5.0 rspec-support/spec/rspec/support/spec/with_isolated_std_err_spec.rb
opal-rspec-0.5.0.beta3 rspec-support/spec/rspec/support/spec/with_isolated_std_err_spec.rb
opal-rspec-0.5.0.beta2 rspec-support/spec/rspec/support/spec/with_isolated_std_err_spec.rb
opal-rspec-0.5.0.beta1 rspec-support/spec/rspec/support/spec/with_isolated_std_err_spec.rb