diff --git a/spec/bson/int64_spec.rb b/spec/bson/int64_spec.rb index 0d010e3..87aa5f1 100644 --- a/spec/bson/int64_spec.rb +++ b/spec/bson/int64_spec.rb @@ -77,12 +77,19 @@ describe BSON::Int64 do end end - context "when using MRI", unless: BSON::Environment.jruby? do + context "when using MRI < 2.4", if: (!BSON::Environment.jruby? && RUBY_VERSION < '2.4') do it "deserializes to a Fixnum object" do expect(described_class.from_bson(bson).class).to be(Fixnum) end end + + context "when using MRI >= 2.4", if: (!BSON::Environment.jruby? && RUBY_VERSION >= '2.4') do + + it "deserializes to an Integer object" do + expect(described_class.from_bson(bson).class).to be(Integer) + end + end end context "when the 64-bit integer is the BSON max and thus larger than the MRI Fixnum range" do @@ -100,12 +107,19 @@ describe BSON::Int64 do end end - context "when using MRI", unless: BSON::Environment.jruby? do + context "when using MRI < 2.4", if: (!BSON::Environment.jruby? && RUBY_VERSION < '2.4') do it "deserializes to a Bignum object" do expect(described_class.from_bson(bson).class).to be(Bignum) end end + + context "when using MRI >= 2.4", if: (!BSON::Environment.jruby? && RUBY_VERSION >= '2.4') do + + it "deserializes to an Integer object" do + expect(described_class.from_bson(bson).class).to be(Integer) + end + end end end