Sha256: 0e221f647cb9ce8588221b6bb78857e6e971c69d06af97b59a1b57071c76ae2e

Contents?: true

Size: 993 Bytes

Versions: 4

Compression:

Stored size: 993 Bytes

Contents

require 'spec_helper'

describe 'CRUD' do

  CRUD_TESTS.each do |file|

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

    context(spec.description) do

      spec.tests.each do |test|

        context(test.description) do

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

            test.setup_test(authorized_collection)
          end

          after(:each) do
            authorized_collection.delete_many
          end

          let!(:results) do
            test.run(authorized_collection)
          end

          it 'returns the correct result' do
            expect(results).to match_operation_result(test)
          end

          it 'has the correct data in the collection', if: test.outcome_collection_data do
            results
            expect(authorized_collection.find.to_a).to match_collection_data(test)
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mongo-2.6.4 spec/spec_tests/crud_spec.rb
mongo-2.6.2 spec/spec_tests/crud_spec.rb
mongo-2.6.1 spec/spec_tests/crud_spec.rb
mongo-2.6.0 spec/spec_tests/crud_spec.rb