Sha256: 34f6a49f1e0e0cfc6af3212a9b9aacd654bd0967e8449cb37739b59c614015d7

Contents?: true

Size: 586 Bytes

Versions: 3

Compression:

Stored size: 586 Bytes

Contents

# encoding: UTF-8

require 'spec_helper'

describe YamlWriteStream::YieldingWriter do
  let(:stream) do
    StringIO.new.tap do |io|
      io.set_encoding(Encoding::UTF_8)
    end
  end

  let(:stream_writer) do
    YieldingRoundtripChecker.create_writer(stream)
  end

  def check_roundtrip(obj)
    YieldingRoundtripChecker.check_roundtrip(obj)
  end

  def utf8(str)
    str.encode(Encoding::UTF_8)
  end

  it_behaves_like 'a yaml stream'

  describe '#close' do
    it 'closes the underlying stream' do
      stream_writer.close
      expect(stream).to be_closed
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
yaml-write-stream-1.0.2 spec/yielding_spec.rb
yaml-write-stream-1.0.1 spec/yielding_spec.rb
yaml-write-stream-1.0.0 spec/yielding_spec.rb