Sha256: 6c56912e2b81e901eb91fc42400adfa6b0633f69f4773ee0dcc44d6638d6c810

Contents?: true

Size: 1.02 KB

Versions: 18

Compression:

Stored size: 1.02 KB

Contents

require 'spec_helper'

describe Mongo::Cursor::Builder::OpGetMore do

  describe '#specification' do

    let(:reply) do
      Mongo::Protocol::Reply.allocate
    end

    let(:result) do
      Mongo::Operation::Result.new(reply)
    end

    let(:view) do
      Mongo::Collection::View.new(
        authorized_collection,
        {},
        tailable: true,
        max_time_ms: 100
      )
    end

    let(:cursor) do
      Mongo::Cursor.new(view, result, authorized_primary)
    end

    let(:builder) do
      described_class.new(cursor)
    end

    let(:specification) do
      builder.specification
    end

    it 'includes to return' do
      expect(specification[:to_return]).to eq(0)
    end

    it 'includes the cursor id' do
      expect(specification[:cursor_id]).to eq(cursor.id)
    end

    it 'includes the database name' do
      expect(specification[:db_name]).to eq(SpecConfig.instance.test_db)
    end

    it 'includes the collection name' do
      expect(specification[:coll_name]).to eq(TEST_COLL)
    end
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/mongo-2.8.0/spec/mongo/cursor/builder/op_get_more_spec.rb
mongo-2.9.2 spec/mongo/cursor/builder/op_get_more_spec.rb
mongo-2.10.2 spec/mongo/cursor/builder/op_get_more_spec.rb
mongo-2.11.0.rc0 spec/mongo/cursor/builder/op_get_more_spec.rb
mongo-2.10.1 spec/mongo/cursor/builder/op_get_more_spec.rb
mongo-2.10.0 spec/mongo/cursor/builder/op_get_more_spec.rb
mongo-2.9.1 spec/mongo/cursor/builder/op_get_more_spec.rb
mongo-2.10.0.rc0 spec/mongo/cursor/builder/op_get_more_spec.rb
mongo-2.9.1.rc0 spec/mongo/cursor/builder/op_get_more_spec.rb
mongo-2.9.0 spec/mongo/cursor/builder/op_get_more_spec.rb
mongo-2.9.0.rc1 spec/mongo/cursor/builder/op_get_more_spec.rb
mongo-2.9.0.rc0 spec/mongo/cursor/builder/op_get_more_spec.rb
mongo-2.8.0 spec/mongo/cursor/builder/op_get_more_spec.rb
mongo-2.7.2 spec/mongo/cursor/builder/op_get_more_spec.rb
mongo-2.8.0.rc0 spec/mongo/cursor/builder/op_get_more_spec.rb
mongo-2.7.1 spec/mongo/cursor/builder/op_get_more_spec.rb
mongo-2.7.0 spec/mongo/cursor/builder/op_get_more_spec.rb
mongo-2.7.0.rc0 spec/mongo/cursor/builder/op_get_more_spec.rb