Sha256: 707e8d4b2417268a092477ab068e602adb55e0c7f2594c07edab6cd6cea9028d

Contents?: true

Size: 718 Bytes

Versions: 175

Compression:

Stored size: 718 Bytes

Contents

require 'spec_helper'
require 'json'

describe MessagePack do
  here = File.dirname(__FILE__)
  CASES         = File.read("#{here}/cases.msg")
  CASES_JSON    = File.read("#{here}/cases.json")
  CASES_COMPACT = File.read("#{here}/cases_compact.msg")

  it 'compare with json' do
    ms = []
    MessagePack::Unpacker.new.feed_each(CASES) {|m|
      ms << m
    }

    js = JSON.load(CASES_JSON)

    ms.zip(js) {|m,j|
      m.should == j
    }
  end

  it 'compare with compat' do
    ms = []
    MessagePack::Unpacker.new.feed_each(CASES) {|m|
      ms << m
    }

    cs = []
    MessagePack::Unpacker.new.feed_each(CASES_COMPACT) {|c|
      cs << c
    }

    ms.zip(cs) {|m,c|
      m.should == c
    }
  end
end

Version data entries

175 entries across 175 versions & 5 rubygems

Version Path
msgpack-1.1.0-x64-mingw32 spec/cases_spec.rb
msgpack-1.1.0-x86-mingw32 spec/cases_spec.rb
msgpack-1.1.0 spec/cases_spec.rb
msgpack-1.0.3-x86-mingw32 spec/cases_spec.rb
msgpack-1.0.3-x64-mingw32 spec/cases_spec.rb
msgpack-1.0.3-java spec/cases_spec.rb
msgpack-1.0.3 spec/cases_spec.rb
msgpack-1.0.2-x64-mingw32 spec/cases_spec.rb
msgpack-1.0.2-x86-mingw32 spec/cases_spec.rb
msgpack-1.0.2-java spec/cases_spec.rb
msgpack-1.0.2 spec/cases_spec.rb
msgpack-1.0.1-java spec/cases_spec.rb
msgpack-1.0.1-x64-mingw32 spec/cases_spec.rb
msgpack-1.0.1-x86-mingw32 spec/cases_spec.rb
msgpack-1.0.1 spec/cases_spec.rb
msgpack-1.0.0-x64-mingw32 spec/cases_spec.rb
msgpack-1.0.0-x86-mingw32 spec/cases_spec.rb
msgpack-1.0.0-java spec/cases_spec.rb
msgpack-1.0.0 spec/cases_spec.rb
msgpack-0.7.6-x64-mingw32 spec/cases_spec.rb