<commit_before>require 'spec_helper'

describe 'CRUD' do

  CRUD_TESTS.each do |file|

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

    if spec.server_version_satisfied?(AUTHORIZED_CLIENT)

      context(spec.description) do

        spec.tests.each do |test|

          context(test.description) do

            before(:each) do
              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
end<commit_msg>Use rspec around to filter out CRUD spec tests<commit_after>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|

        around do |example|
          if spec.server_version_satisfied?(authorized_client)
            example.run
          end
        end

        context(test.description) do

          before(:each) do
            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
{'fraction_non_alphanumeric': 0.06718979892103973, 'fraction_numerical': 0.0, 'mean_word_length': 1.8215767634854771, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5684785', 'n_tokens_mistral': 563, 'n_tokens_neox': 537, 'n_words': 134}