bson 4.2.1 → 4.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/bson/decimal128.rb +1 -0
- data/lib/bson/object_id.rb +5 -0
- data/lib/bson/version.rb +1 -1
- data/spec/bson/decimal128_spec.rb +2 -0
- data/spec/bson/int64_spec.rb +19 -5
- data/spec/bson/object_id_spec.rb +37 -0
- metadata +10 -10
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e76c5872004b8c218e35db5ae4db7e2a0f69449
|
4
|
+
data.tar.gz: 40dc1aac62c0f7a59eed2a6a9619743927a66ae6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e820f483f475073365955ec222c92771ca5ed5bc2547c82eeabc353a1dd9153e1a5fff8a878428ba0e781e8f2c8f2d341b858423407469d7d6947324f3ff3b8
|
7
|
+
data.tar.gz: c0fdd409db1055211502f7f2b3527d298d6e0e6ece5bde64418b0291e709e50eda0471951ccc10c57a86f9cdcd7e2ee9353bda19c7fd02f61fcc593612db65c0
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/bson/decimal128.rb
CHANGED
data/lib/bson/object_id.rb
CHANGED
data/lib/bson/version.rb
CHANGED
@@ -1257,6 +1257,8 @@ describe BSON::Decimal128 do
|
|
1257
1257
|
it "returns the decimal128 with $numberDecimal key" do
|
1258
1258
|
expect(object.as_json).to eq({ "$numberDecimal" => object.to_s })
|
1259
1259
|
end
|
1260
|
+
|
1261
|
+
it_behaves_like "a JSON serializable object"
|
1260
1262
|
end
|
1261
1263
|
|
1262
1264
|
describe "::BSON_TYPE" do
|
data/spec/bson/int64_spec.rb
CHANGED
@@ -64,10 +64,10 @@ describe BSON::Int64 do
|
|
64
64
|
|
65
65
|
context "when the integer is within the MRI Fixnum range" do
|
66
66
|
|
67
|
-
let(:integer) {
|
67
|
+
let(:integer) { 2**30 - 1 }
|
68
68
|
|
69
69
|
let(:bson) do
|
70
|
-
BSON::ByteBuffer.new(integer.to_bson.to_s)
|
70
|
+
BSON::ByteBuffer.new(BSON::Int64.new(integer).to_bson.to_s)
|
71
71
|
end
|
72
72
|
|
73
73
|
context "when on JRuby", if: BSON::Environment.jruby? do
|
@@ -77,15 +77,22 @@ describe BSON::Int64 do
|
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
80
|
-
context "when using MRI",
|
80
|
+
context "when using MRI < 2.4", if: (!BSON::Environment.jruby? && RUBY_VERSION < '2.4') do
|
81
81
|
|
82
82
|
it "deserializes to a Fixnum object" do
|
83
83
|
expect(described_class.from_bson(bson).class).to be(Fixnum)
|
84
84
|
end
|
85
85
|
end
|
86
|
+
|
87
|
+
context "when using MRI >= 2.4", if: (!BSON::Environment.jruby? && RUBY_VERSION >= '2.4') do
|
88
|
+
|
89
|
+
it "deserializes to an Integer object" do
|
90
|
+
expect(described_class.from_bson(bson).class).to be(Integer)
|
91
|
+
end
|
92
|
+
end
|
86
93
|
end
|
87
94
|
|
88
|
-
context "when the 64-bit integer is the BSON max and thus larger than the MRI Fixnum range" do
|
95
|
+
context "when the 64-bit integer is the BSON max and thus larger than the MRI Fixnum range on all architectures" do
|
89
96
|
|
90
97
|
let(:integer) { Integer::MAX_64BIT }
|
91
98
|
|
@@ -100,12 +107,19 @@ describe BSON::Int64 do
|
|
100
107
|
end
|
101
108
|
end
|
102
109
|
|
103
|
-
context "when using MRI",
|
110
|
+
context "when using MRI < 2.4", if: (!BSON::Environment.jruby? && RUBY_VERSION < '2.4') do
|
104
111
|
|
105
112
|
it "deserializes to a Bignum object" do
|
106
113
|
expect(described_class.from_bson(bson).class).to be(Bignum)
|
107
114
|
end
|
108
115
|
end
|
116
|
+
|
117
|
+
context "when using MRI >= 2.4", if: (!BSON::Environment.jruby? && RUBY_VERSION >= '2.4') do
|
118
|
+
|
119
|
+
it "deserializes to an Integer object" do
|
120
|
+
expect(described_class.from_bson(bson).class).to be(Integer)
|
121
|
+
end
|
122
|
+
end
|
109
123
|
end
|
110
124
|
end
|
111
125
|
|
data/spec/bson/object_id_spec.rb
CHANGED
@@ -392,6 +392,43 @@ describe BSON::ObjectId do
|
|
392
392
|
end
|
393
393
|
end
|
394
394
|
|
395
|
+
describe "#clone" do
|
396
|
+
|
397
|
+
context "when the data has not been generated yet" do
|
398
|
+
|
399
|
+
let!(:object_id) do
|
400
|
+
described_class.new
|
401
|
+
end
|
402
|
+
|
403
|
+
let!(:clone) do
|
404
|
+
object_id.clone
|
405
|
+
end
|
406
|
+
|
407
|
+
it "generates and copies the data" do
|
408
|
+
expect(clone).to eq(object_id)
|
409
|
+
end
|
410
|
+
end
|
411
|
+
|
412
|
+
context "when the data has been generated" do
|
413
|
+
|
414
|
+
let!(:object_id) do
|
415
|
+
described_class.new
|
416
|
+
end
|
417
|
+
|
418
|
+
let(:clone) do
|
419
|
+
object_id.clone
|
420
|
+
end
|
421
|
+
|
422
|
+
before do
|
423
|
+
object_id.to_s
|
424
|
+
end
|
425
|
+
|
426
|
+
it "copies the data" do
|
427
|
+
expect(clone).to eq(object_id)
|
428
|
+
end
|
429
|
+
end
|
430
|
+
end
|
431
|
+
|
395
432
|
describe "#inspect" do
|
396
433
|
|
397
434
|
let(:object_id) do
|
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.2.
|
4
|
+
version: 4.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tyler Brock
|
@@ -16,7 +16,7 @@ cert_chain:
|
|
16
16
|
-----BEGIN CERTIFICATE-----
|
17
17
|
MIIDfDCCAmSgAwIBAgIBATANBgk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K/9nwQ
|
35
|
+
FACf8zd11PEds/Opai2Qp4aOBgaxXhhFG357umy1vRs=
|
36
36
|
-----END CERTIFICATE-----
|
37
|
-
date:
|
37
|
+
date: 2017-07-03 00:00:00.000000000 Z
|
38
38
|
dependencies: []
|
39
39
|
description: A full featured BSON specification implementation, in Ruby
|
40
40
|
email:
|
@@ -177,7 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
177
177
|
version: 1.3.6
|
178
178
|
requirements: []
|
179
179
|
rubyforge_project: bson
|
180
|
-
rubygems_version: 2.6.
|
180
|
+
rubygems_version: 2.6.11
|
181
181
|
signing_key:
|
182
182
|
specification_version: 4
|
183
183
|
summary: Ruby Implementation of the BSON specification
|
metadata.gz.sig
CHANGED
Binary file
|