Sha256: 5a64df357c1e4a3a77f48b29a79d55cac7fccd8a39bd9d11816e1511fdbe6682

Contents?: true

Size: 487 Bytes

Versions: 2

Compression:

Stored size: 487 Bytes

Contents

require 'spec_helper'

describe AsciiPack::Packer do
  let :packer do
    AsciiPack::Packer.new
  end

  it "pack:to_s:clear" do
    packer.write nil
    expect(packer.to_s).to eq(T.nil)

    packer.write 0
    expect(packer.to_s).to eq(T.nil + T.positive_fixint_0)

    packer.write "a"
    expect(packer.to_s).to eq(T.nil + T.positive_fixint_0 + T.fixstr_1 + "a")

    packer.clear
    expect(packer.to_s).to eq("")

    packer.write nil
    expect(packer.to_s).to eq(T.nil)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
asciipack-0.2.4 spec/packer_spec.rb
asciipack-0.2.3 spec/packer_spec.rb