Sha256: 2440a61514d06920f8638f792e1455bae9782ff2c60a261b378a784cde742d08

Contents?: true

Size: 923 Bytes

Versions: 43

Compression:

Stored size: 923 Bytes

Contents

require 'spec_helper'

describe Mongo::Operation::KillCursors::Legacy do

  let(:spec) do
    { coll_name: TEST_COLL,
      db_name: SpecConfig.instance.test_db,
      :cursor_ids => [1,2]
    }
  end
  let(:op) { described_class.new(spec) }

  describe '#initialize' do

    it 'sets the spec' do
      expect(op.spec).to be(spec)
    end
  end

  describe '#==' do

    context ' when two ops have different specs' do
      let(:other_spec) do
        { :cursor_ids => [1, 2, 3] }
      end
      let(:other) { described_class.new(other_spec) }

      it 'returns false' do
        expect(op).not_to eq(other)
      end
    end
  end

  describe '#message' do

    it 'creates a kill cursors wire protocol message with correct specs' do
      expect(Mongo::Protocol::KillCursors).to receive(:new).with(TEST_COLL, SpecConfig.instance.test_db, spec[:cursor_ids])
      op.send(:message, double('server'))
    end
  end
end

Version data entries

43 entries across 43 versions & 2 rubygems

Version Path
mongo-2.13.3 spec/mongo/operation/kill_cursors_spec.rb
mongo-2.14.1 spec/mongo/operation/kill_cursors_spec.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/mongo-2.8.0/spec/mongo/operation/kill_cursors_spec.rb
mongo-2.15.0.alpha spec/mongo/operation/kill_cursors_spec.rb
mongo-2.13.2 spec/mongo/operation/kill_cursors_spec.rb
mongo-2.14.0 spec/mongo/operation/kill_cursors_spec.rb
mongo-2.14.0.rc1 spec/mongo/operation/kill_cursors_spec.rb
mongo-2.13.1 spec/mongo/operation/kill_cursors_spec.rb
mongo-2.12.4 spec/mongo/operation/kill_cursors_spec.rb
mongo-2.11.6 spec/mongo/operation/kill_cursors_spec.rb
mongo-2.13.0 spec/mongo/operation/kill_cursors_spec.rb
mongo-2.12.3 spec/mongo/operation/kill_cursors_spec.rb
mongo-2.13.0.rc1 spec/mongo/operation/kill_cursors_spec.rb
mongo-2.12.2 spec/mongo/operation/kill_cursors_spec.rb
mongo-2.10.5 spec/mongo/operation/kill_cursors_spec.rb
mongo-2.11.5 spec/mongo/operation/kill_cursors_spec.rb
mongo-2.13.0.beta1 spec/mongo/operation/kill_cursors_spec.rb
mongo-2.12.1 spec/mongo/operation/kill_cursors_spec.rb
mongo-2.12.0.rc0 spec/mongo/operation/kill_cursors_spec.rb
mongo-2.11.4 spec/mongo/operation/kill_cursors_spec.rb