msgpack 0.7.2-java → 0.7.3-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7e9f600880b1344d73ad9f73f30d4d3ad670f2f9
4
- data.tar.gz: 00c7fd5efdc65b186094fe7b1cb602262c609561
3
+ metadata.gz: 8f5d65b7af869bd2939df3d101222b608a5b601e
4
+ data.tar.gz: b41f4d06f3a84d90478d508f3a1efe3d612e5cd7
5
5
  SHA512:
6
- metadata.gz: 50474f06ad0d0e646cab3d38fc91406a4bc6a6175a8babe92c658467dd492c177f8eb35a459eb42e7cba8f11134a49a9e09c0823c9bd9fb2d8c93fb084ca1d40
7
- data.tar.gz: 1270ea75bdb658584873122ab6a6e04251ffb992b26eef3289dd7d386da6f5462ccd17e758f45cd67df9e217eab2e61c0d245002090a6d6bdb5d4a5376ea6652
6
+ metadata.gz: 4709e1faf80cc6f2d58c9e40b1692c517279194efadef097c74be99f1ee8d7e3229a324e30901df0a583163e47ab6e42b99b7739786a568b01e17fb2d7b1a8e6
7
+ data.tar.gz: edd880415747d6c932deb76f1b69048a2c7eb2a885a2e03a8d05b61e72608be990173adcffa7ec29d66de61361e517273f63d7dd11c2f46d75bdc87b28fd8724
Binary file
@@ -1,3 +1,3 @@
1
1
  module MessagePack
2
- VERSION = "0.7.2"
2
+ VERSION = "0.7.3"
3
3
  end
@@ -134,6 +134,30 @@ describe MessagePack::Packer do
134
134
  packer.to_s.should == "\x81"
135
135
  end
136
136
 
137
+ describe '#write_float32' do
138
+ tests = [
139
+ ['small floats', 3.14, "\xCA\x40\x48\xF5\xC3"],
140
+ ['big floats', Math::PI * 1_000_000_000_000_000_000, "\xCA\x5E\x2E\x64\xB7"],
141
+ ['negative floats', -2.1, "\xCA\xC0\x06\x66\x66"],
142
+ ['integer', 123, "\xCA\x42\xF6\x00\x00"],
143
+ ]
144
+
145
+ tests.each do |ctx, numeric, packed|
146
+ context("with #{ctx}") do
147
+ it("encodes #{numeric} as float32") do
148
+ packer.write_float32(numeric)
149
+ packer.to_s.should == packed
150
+ end
151
+ end
152
+ end
153
+
154
+ context 'with non numeric' do
155
+ it 'raises argument error' do
156
+ expect { packer.write_float32('abc') }.to raise_error(ArgumentError)
157
+ end
158
+ end
159
+ end
160
+
137
161
  it 'flush' do
138
162
  io = StringIO.new
139
163
  pk = MessagePack::Packer.new(io)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: msgpack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.3
5
5
  platform: java
6
6
  authors:
7
7
  - Sadayuki Furuhashi
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-01-06 00:00:00.000000000 Z
13
+ date: 2016-01-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  requirement: !ruby/object:Gem::Requirement