diff --git a/mongo.gemspec b/mongo.gemspec index 0226011936..2c58491b8b 100644 --- a/mongo.gemspec +++ b/mongo.gemspec @@ -41,11 +41,5 @@ Gem::Specification.new do |s| s.required_ruby_version = ">= 2.5" - # For testing driver against bson master we need to depend on bson < 6.0.0 - # but in release version we want to depend on bson < 5.0.0. - if %w(1 yes true).include?(ENV['MONGO_RUBY_DRIVER_BSON_MASTER']) - s.add_dependency 'bson', '>=4.13.0', '<6.0.0' - else - s.add_dependency 'bson', '>=4.14.1', '<5.0.0' - end + s.add_dependency 'bson', '>=4.14.1', '<6.0.0' end diff --git a/spec/integration/client_side_encryption/corpus_spec.rb b/spec/integration/client_side_encryption/corpus_spec.rb index 2ecc8e40df..aac6347694 100644 --- a/spec/integration/client_side_encryption/corpus_spec.rb +++ b/spec/integration/client_side_encryption/corpus_spec.rb @@ -188,6 +188,15 @@ key_vault_collection.insert_one(kmip_data_key) end + # This method compensates for an API change between BSON 4 and + # BSON 5. + def normalize_cse_value(a) + case a + when BSON::Decimal128 then a.to_d + else a + end + end + shared_context 'with jsonSchema collection validator' do let(:local_schema_map) { nil } @@ -228,12 +237,11 @@ .find(_id: corpus_encrypted_id) .first - corpus_encrypted_actual.each do |key, value| # If it was deterministically encrypted, test the encrypted values # for equality. if value['algo'] == 'det' - expect(value['value']).to eq(corpus_encrypted_expected[key]['value']) + expect(normalize_cse_value(value['value'])).to eq(normalize_cse_value(corpus_encrypted_expected[key]['value'])) else # If the document was randomly encrypted, the two encrypted values # will not be equal. Ensure that they are equal when decrypted. diff --git a/spec/shared b/spec/shared index bd968a969a..cee4bc0264 160000 --- a/spec/shared +++ b/spec/shared @@ -1 +1 @@ -Subproject commit bd968a969aed7ae4d579855f2ce5b3e3201444a4 +Subproject commit cee4bc02649a573c8256b0505c1d23f503ac2609