Sha256: 0e81d9d4e2d9847322b553f27af32a1676f516d966dad910da91650493b5979d

Contents?: true

Size: 1.35 KB

Versions: 12

Compression:

Stored size: 1.35 KB

Contents

require 'spec_helper'

describe 'ChangeStreams' do
  require_wired_tiger

  CHANGE_STREAMS_TESTS.each do |file|

    spec = Mongo::ChangeStreams::Spec.new(file)

    context(spec.description) do

      spec.tests.each do |test|

        context(test.description) do
          require_topology *test.topologies

          before(:each) do
            unless test.server_version_satisfied?(authorized_client)
              skip 'Version requirements not satisfied'
            end

            test.setup_test
          end

          let(:result) do
            test.run
          end

          let(:verifier) { Mongo::CRUD::Verifier.new(test) }

          it 'returns the correct result' do
            expect(result[:result]).to match_result(test)
          end

          if test.expectations
            let(:actual_events) do
              result[:events]
            end

            it 'has the correct number of command_started events' do
              verifier.verify_command_started_event_count(test.expectations, actual_events)
            end

            test.expectations.each_with_index do |expectation, i|
              it "has the correct command_started event #{i+1}" do
                verifier.verify_command_started_event(
                  test.expectations, actual_events, i)
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
mongo-2.12.4 spec/spec_tests/change_streams_spec.rb
mongo-2.11.6 spec/spec_tests/change_streams_spec.rb
mongo-2.12.3 spec/spec_tests/change_streams_spec.rb
mongo-2.12.2 spec/spec_tests/change_streams_spec.rb
mongo-2.11.5 spec/spec_tests/change_streams_spec.rb
mongo-2.12.1 spec/spec_tests/change_streams_spec.rb
mongo-2.12.0.rc0 spec/spec_tests/change_streams_spec.rb
mongo-2.11.4 spec/spec_tests/change_streams_spec.rb
mongo-2.11.3 spec/spec_tests/change_streams_spec.rb
mongo-2.11.2 spec/spec_tests/change_streams_spec.rb
mongo-2.11.1 spec/spec_tests/change_streams_spec.rb
mongo-2.11.0 spec/spec_tests/change_streams_spec.rb