bson 4.10.1-java → 4.11.0-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +2 -2
- data.tar.gz.sig +0 -0
- data/lib/bson-ruby.jar +0 -0
- data/lib/bson/version.rb +1 -1
- data/spec/bson/byte_buffer_spec.rb +43 -2
- data/spec/bson/hash_spec.rb +56 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7adb7902f9a5a688e440c021e8db54f373cd49930f1ca26e4be4242978c86dd8
|
4
|
+
data.tar.gz: f4e42673b1d7becb9d069b5837026b171d3d1884d5548c7a04dc90fbc4e255b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97b70aad52dc56049c3776b2348d5f8bf9cea1053fa7dbbad4b05a43677cff6ad0ea6be227601270cc260de21e0d082b3cf950211078b23f16f813779d53e2e0
|
7
|
+
data.tar.gz: a4b983b9900bdf88d9fab2e188cad8819ba9738a4a8c0da937d42123455b703c3bd03317e248ec18254e407d28ab4c21aac3cf9fd0cfdea4e61d5aa00d165093
|
checksums.yaml.gz.sig
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
��G��ch��M*��=\llF��RӠO��v�C�O0�qR�b�T��ɿ��A��5a�2�61���OF�i�m���ז�o�)�C�X&h���H�轄��oi`4�"���Kh��~^������`
|
2
|
+
�eG�Vn�k��/��|�8�.#H���FI�V���7��Gm�#s�=-,���B��i���ʺ�.����ӗ{M�8o�'�-��s��t��,G�H��!lՎ�8m�G|�`���~����)�|L\CS
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/bson-ruby.jar
CHANGED
Binary file
|
data/lib/bson/version.rb
CHANGED
@@ -30,8 +30,8 @@ describe BSON::ByteBuffer do
|
|
30
30
|
let(:buffer) do
|
31
31
|
described_class.new
|
32
32
|
end
|
33
|
-
|
34
|
-
context '#put_int32' do
|
33
|
+
|
34
|
+
context '#put_int32' do
|
35
35
|
before do
|
36
36
|
buffer.put_int32(5)
|
37
37
|
end
|
@@ -107,4 +107,45 @@ describe BSON::ByteBuffer do
|
|
107
107
|
expect(buffer.write_position).to eq(1)
|
108
108
|
end
|
109
109
|
end
|
110
|
+
|
111
|
+
describe 'write followed by read' do
|
112
|
+
let(:buffer) do
|
113
|
+
described_class.new
|
114
|
+
end
|
115
|
+
|
116
|
+
context 'one cycle' do
|
117
|
+
it 'returns the written data' do
|
118
|
+
buffer.put_cstring('hello')
|
119
|
+
buffer.get_cstring.should == 'hello'
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
context 'two cycles' do
|
124
|
+
it 'returns the written data' do
|
125
|
+
buffer.put_cstring('hello')
|
126
|
+
buffer.get_cstring.should == 'hello'
|
127
|
+
|
128
|
+
buffer.put_cstring('world')
|
129
|
+
buffer.get_cstring.should == 'world'
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
context 'mixed cycles' do
|
134
|
+
it 'returns the written data' do
|
135
|
+
if BSON::Environment.jruby?
|
136
|
+
pending 'RUBY-2334'
|
137
|
+
end
|
138
|
+
|
139
|
+
buffer.put_int32(1)
|
140
|
+
buffer.put_int32(2)
|
141
|
+
|
142
|
+
buffer.get_int32.should == 1
|
143
|
+
|
144
|
+
buffer.put_int32(3)
|
145
|
+
|
146
|
+
buffer.get_int32.should == 2
|
147
|
+
buffer.get_int32.should == 3
|
148
|
+
end
|
149
|
+
end
|
150
|
+
end
|
110
151
|
end
|
data/spec/bson/hash_spec.rb
CHANGED
@@ -244,6 +244,16 @@ describe Hash do
|
|
244
244
|
/(Hash value for key 'foo'|Value) does not define its BSON serialized type:.*HashSpecUnserializableClass/)
|
245
245
|
end
|
246
246
|
end
|
247
|
+
|
248
|
+
context 'when reading from a byte buffer that was previously written to' do
|
249
|
+
let(:buffer) do
|
250
|
+
{foo: 42}.to_bson
|
251
|
+
end
|
252
|
+
|
253
|
+
it 'returns the original hash' do
|
254
|
+
expect(Hash.from_bson(buffer)).to eq('foo' => 42)
|
255
|
+
end
|
256
|
+
end
|
247
257
|
end
|
248
258
|
|
249
259
|
describe '#to_bson' do
|
@@ -310,4 +320,50 @@ describe Hash do
|
|
310
320
|
end
|
311
321
|
end
|
312
322
|
end
|
323
|
+
|
324
|
+
describe '#from_bson' do
|
325
|
+
context 'when bson document has duplicate keys' do
|
326
|
+
let(:buf) do
|
327
|
+
buf = BSON::ByteBuffer.new
|
328
|
+
buf.put_int32(37)
|
329
|
+
buf.put_byte("\x02")
|
330
|
+
buf.put_cstring('foo')
|
331
|
+
buf.put_string('bar')
|
332
|
+
buf.put_byte("\x02")
|
333
|
+
buf.put_cstring('foo')
|
334
|
+
buf.put_string('overwrite')
|
335
|
+
buf.put_byte("\x00")
|
336
|
+
|
337
|
+
BSON::ByteBuffer.new(buf.to_s)
|
338
|
+
end
|
339
|
+
|
340
|
+
let(:doc) { Hash.from_bson(buf) }
|
341
|
+
|
342
|
+
it 'overwrites first value with second value' do
|
343
|
+
doc.should == {'foo' => 'overwrite'}
|
344
|
+
end
|
345
|
+
end
|
346
|
+
|
347
|
+
context 'when bson document has string and symbol keys of the same name' do
|
348
|
+
let(:buf) do
|
349
|
+
buf = BSON::ByteBuffer.new
|
350
|
+
buf.put_int32(31)
|
351
|
+
buf.put_byte("\x02")
|
352
|
+
buf.put_cstring('foo')
|
353
|
+
buf.put_string('bar')
|
354
|
+
buf.put_byte("\x0e")
|
355
|
+
buf.put_cstring('foo')
|
356
|
+
buf.put_string('bar')
|
357
|
+
buf.put_byte("\x00")
|
358
|
+
|
359
|
+
BSON::ByteBuffer.new(buf.to_s)
|
360
|
+
end
|
361
|
+
|
362
|
+
let(:doc) { Hash.from_bson(buf) }
|
363
|
+
|
364
|
+
it 'overwrites first value with second value' do
|
365
|
+
doc.should == {'foo' => :bar}
|
366
|
+
end
|
367
|
+
end
|
368
|
+
end
|
313
369
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bson
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.11.0
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Tyler Brock
|
@@ -33,7 +33,7 @@ cert_chain:
|
|
33
33
|
gpvfPNWMwyBDlHaNS3GfO6cRRxBOvEG05GUCsvtTY4Bpe8yjE64wg1ymb47LMOnv
|
34
34
|
Qb1lGORmf/opg45mluKUYl7pQNZHD0d3
|
35
35
|
-----END CERTIFICATE-----
|
36
|
-
date: 2020-10-
|
36
|
+
date: 2020-10-21 00:00:00.000000000 Z
|
37
37
|
dependencies: []
|
38
38
|
description: A fully featured BSON specification implementation in Ruby
|
39
39
|
email:
|
metadata.gz.sig
CHANGED
Binary file
|