Sha256: af76776a3b41afc3a795861455df55fb293a921f44512a4e505105151e4925dd

Contents?: true

Size: 1.06 KB

Versions: 10

Compression:

Stored size: 1.06 KB

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
            authorized_collection.delete_many
          end

          after(:each) do
            authorized_collection.delete_many
          end

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

          it 'returns the correct result' do
            skip 'Test cannot be run on this server version' unless spec.server_version_satisfied?(authorized_client)
            expect(results).to match_operation_result(test)
          end

          it 'has the correct data in the collection', if: test.outcome_collection_data do
            skip 'Test cannot be run on this server version' unless spec.server_version_satisfied?(authorized_client)
            results
            expect(authorized_collection.find.to_a).to match_collection_data(test)
          end
        end
      end
    end
  end
end

Version data entries

10 entries across 8 versions & 2 rubygems

Version Path
mongo-2.5.0.beta spec/mongo/crud_spec.rb
mongo-2.4.3 spec/mongo/crud_spec.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/mongo-2.4.1/spec/mongo/crud_spec.rb
tdiary-5.0.5 vendor/bundle/gems/mongo-2.4.1/spec/mongo/crud_spec.rb
tdiary-5.0.5 vendor/bundle/gems/mongo-2.4.2/spec/mongo/crud_spec.rb
mongo-2.4.2 spec/mongo/crud_spec.rb
tdiary-5.0.4 vendor/bundle/gems/mongo-2.4.1/spec/mongo/crud_spec.rb
mongo-2.4.1 spec/mongo/crud_spec.rb
mongo-2.4.0 spec/mongo/crud_spec.rb
mongo-2.4.0.rc1 spec/mongo/crud_spec.rb