Sha256: b150fc8ee54d65ab63e6dc64a159859229df2b1bc6b406dab1dbca84d67c1325

Contents?: true

Size: 828 Bytes

Versions: 9

Compression:

Stored size: 828 Bytes

Contents

# frozen_string_literal: true
# rubocop:todo all

require 'spec_helper'

describe 'getMore operation' do
  # https://jira.mongodb.org/browse/RUBY-1987
  min_server_fcv '3.2'

  let(:subscriber) { Mrss::EventSubscriber.new }

  let(:client) do
    authorized_client.tap do |client|
      client.subscribe(Mongo::Monitoring::COMMAND, subscriber)
    end
  end

  let(:collection) do
    client['get_more_spec']
  end

  let(:scope) do
    collection.find.batch_size(1).each
  end

  before do
    collection.delete_many
    collection.insert_one(a: 1)
    #collection.insert_one(a: 2)
  end

  let(:get_more_command) do
    event = subscriber.single_command_started_event('getMore')
    event.command['getMore']
  end

  it 'sends cursor id as int64' do
    scope.to_a

    expect(get_more_command).to be_a(BSON::Int64)
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
mongo-2.21.0 spec/integration/get_more_spec.rb
mongo-2.20.1 spec/integration/get_more_spec.rb
mogno-2.20.0 spec/integration/get_more_spec.rb
mogno-1.0.0 spec/integration/get_more_spec.rb
mongo-2.20.0 spec/integration/get_more_spec.rb
mongo-2.19.3 spec/integration/get_more_spec.rb
mongo-2.19.2 spec/integration/get_more_spec.rb
mongo-2.19.1 spec/integration/get_more_spec.rb
mongo-2.19.0 spec/integration/get_more_spec.rb