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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 74c61b5517699b4e2efe7c77388850d8c426f613c39f1dea0028b24235f828d7
4
- data.tar.gz: 351435e72e0ad3be977b576aebb5c58d3f12fac09399134a6391b0b87dadf4c7
3
+ metadata.gz: 7adb7902f9a5a688e440c021e8db54f373cd49930f1ca26e4be4242978c86dd8
4
+ data.tar.gz: f4e42673b1d7becb9d069b5837026b171d3d1884d5548c7a04dc90fbc4e255b1
5
5
  SHA512:
6
- metadata.gz: 85bd28f0b946f955a2fe02d117114caf1dd2d9eefa68e0a207cd06606a89ace7eb08569f05911f66e28db7b6591bd600ca4457cd2cd0dce1092616e0a7539153
7
- data.tar.gz: f7cf8b8b49336918c3546dec2089936277a123ae4e45e246280189a11c579a5b84d4d72702bbfc0eac6fcf9df202a88c4536b7b18a93bc12bee2ccd3cdc03006
6
+ metadata.gz: 97b70aad52dc56049c3776b2348d5f8bf9cea1053fa7dbbad4b05a43677cff6ad0ea6be227601270cc260de21e0d082b3cf950211078b23f16f813779d53e2e0
7
+ data.tar.gz: a4b983b9900bdf88d9fab2e188cad8819ba9738a4a8c0da937d42123455b703c3bd03317e248ec18254e407d28ab4c21aac3cf9fd0cfdea4e61d5aa00d165093
@@ -1,2 +1,2 @@
1
- ��р����@/�.R'P����7{*������xq|<��u_rjj33aa���Y�{9^�q����Ҕ8��#�ҭ�tE�cw��iF�n�i��W���d�5o� �t~1p����ЏE��FMi'��QG)O��t�~�Ct{nͳC�w�� ]c
2
- {sVZA�ۧ�*��9Y�� ��^�ױ9 ^WKq�g�MCQ�H�x4Tf��@�/N��Lw^|��' ' Ș
1
+ ��G��ch��M*��=\llF��RӠO��vCO0qRbT��ɿ��A��5a 261���OF�i�m���ז�o�)�C�X&h���H�轄��oi`4�"���Kh��~^������`
2
+ eG�Vnk��/��|�8�.#H���FI�V���7��Gm�#s�=-,���B��i���ʺ�.����ӗ{M�8o�'�-��s��t��,GH��!lՎ� 8m�G|�`���~����)�|L\CS
data.tar.gz.sig CHANGED
Binary file
Binary file
@@ -13,5 +13,5 @@
13
13
  # limitations under the License.
14
14
 
15
15
  module BSON
16
- VERSION = "4.10.1".freeze
16
+ VERSION = "4.11.0".freeze
17
17
  end
@@ -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
@@ -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.10.1
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-13 00:00:00.000000000 Z
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