Sha256: d83ff3870ed9d79cf333b630db100adc5bf059e60323e121c937241ed0d3302d

Contents?: true

Size: 398 Bytes

Versions: 10

Compression:

Stored size: 398 Bytes

Contents

describe Kernel do

  it 'should capture STDOUT text' do
    capture_stdout do
      puts "hello\nworld!"
    end.should == "hello\nworld!\n"
  end
  
  it 'should restore STDOUT correctly on exceptions' do
    old = $stdout
    old.should == STDOUT
    begin
      capture_stdout do
        raise 'foo'
      end
    rescue
    end
    $stdout.should == STDOUT
    $stdout.should == old
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
iron-extensions-1.2.2 spec/extensions/kernel_spec.rb
iron-extensions-1.2.1 spec/extensions/kernel_spec.rb
iron-extensions-1.2.0 spec/extensions/kernel_spec.rb
iron-extensions-1.1.5 spec/extensions/kernel_spec.rb
iron-extensions-1.1.4 spec/extensions/kernel_spec.rb
iron-extensions-1.1.3 spec/extensions/kernel_spec.rb
iron-extensions-1.1.2 spec/extensions/kernel_spec.rb
iron-extensions-1.1.1 spec/extensions/kernel_spec.rb
iron-extensions-1.1.0 spec/extensions/kernel_spec.rb
iron-extensions-1.0.1 spec/extensions/kernel_spec.rb