diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 11bb45a214..74c97f2ec8 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -55,12 +55,6 @@ Lint/UnderscorePrefixedVariableName: - 'spec/mongo/server/monitor_spec.rb' - 'spec/support/local_resource_registry.rb' -# Offense count: 2 -Lint/UnreachableCode: - Exclude: - - 'lib/mongo/protocol/serializers.rb' - - 'spec/runners/unified/test.rb' - # Offense count: 2 # Configuration parameters: AllowedPatterns. # AllowedPatterns: (?-mix:(exactly|at_least|at_most)\(\d+\)\.times) diff --git a/lib/mongo/protocol/serializers.rb b/lib/mongo/protocol/serializers.rb index 0902fc6fe5..804081569c 100644 --- a/lib/mongo/protocol/serializers.rb +++ b/lib/mongo/protocol/serializers.rb @@ -319,16 +319,8 @@ def self.serialize(buffer, value, max_bson_size = nil, _validating_keys = nil) # @return [ Array ] Deserialized section. # # @since 2.5.0 - def self.deserialize(buffer) + def self.deserialize(buffer, _options = {}) raise NotImplementedError - - start_size = buffer.length - section_size = buffer.get_int32 # get the size - end_size = start_size - section_size - buffer.get_cstring # get the identifier - documents = [] - documents << BSON::Document.from_bson(buffer) until buffer.length == end_size - documents end end end diff --git a/spec/runners/unified/test.rb b/spec/runners/unified/test.rb index ecbde6fef5..6e123c281e 100644 --- a/spec/runners/unified/test.rb +++ b/spec/runners/unified/test.rb @@ -527,7 +527,6 @@ def execute_operation(op, propagate_errors: false) public_send(method_name, op) rescue Mongo::Error, bson_error, Mongo::Auth::Unauthorized, ArgumentError => e if expected_error.use('isTimeoutError') && !e.is_a?(Mongo::Error::TimeoutError) - raise e raise Error::ErrorMismatch, %,Expected TimeoutError ("isTimeoutError") but got #{e}, end # isClientError doesn't actually mean a client error.