<commit_before>require 'ruby_event_store/rom/event_repository'
require 'ruby_event_store/spec/event_repository_lint'

module RubyEventStore::ROM
  RSpec.shared_examples :rom_event_repository do |repository_class|
    subject(:repository) { repository_class.new(rom: env) }

    let(:env) { rom_helper.env }
    let(:container) { env.container }
    let(:rom_db) { container.gateways[:default] }

    around(:each) do |example|
      rom_helper.run_lifecycle { example.run }
    end

    let(:test_race_conditions_auto)  { rom_helper.has_connection_pooling? }
    let(:test_race_conditions_any)   { rom_helper.has_connection_pooling? }
    let(:test_expected_version_auto) { true }
    let(:test_link_events_to_stream) { true }
    let(:test_binary) { false }
    let(:test_change) { false }

    let(:default_stream) { RubyEventStore::Stream.new('stream') }
    let(:global_stream) { RubyEventStore::Stream.new('all') }
    let(:mapper) { RubyEventStore::Mappers::NullMapper.new }

    let(:reader) { RubyEventStore::SpecificationReader.new(repository, mapper) }
    let(:specification) { RubyEventStore::Specification.new(reader) }

    it_behaves_like :event_repository, repository_class

    specify "#initialize requires ROM::Env" do
      expect{repository_class.new(rom: nil)}.to raise_error do |err|
        expect(err).to be_a(ArgumentError)
        expect(err.message).to eq("Must specify rom")<commit_msg>Except the ROM repository where it is not implemented yet<commit_after>require 'ruby_event_store/rom/event_repository'
require 'ruby_event_store/spec/event_repository_lint'

module RubyEventStore::ROM
  RSpec.shared_examples :rom_event_repository do |repository_class|
    subject(:repository) { repository_class.new(rom: env) }

    let(:env) { rom_helper.env }
    let(:container) { env.container }
    let(:rom_db) { container.gateways[:default] }

    around(:each) do |example|
      rom_helper.run_lifecycle { example.run }
    end

    let(:test_race_conditions_auto)  { rom_helper.has_connection_pooling? }
    let(:test_race_conditions_any)   { rom_helper.has_connection_pooling? }
    let(:test_expected_version_auto) { true }
    let(:test_link_events_to_stream) { true }
    let(:test_read_by_event_ids)     { false }
    let(:test_binary) { false }
    let(:test_change) { false }

    let(:default_stream) { RubyEventStore::Stream.new('stream') }
    let(:global_stream) { RubyEventStore::Stream.new('all') }
    let(:mapper) { RubyEventStore::Mappers::NullMapper.new }

    let(:reader) { RubyEventStore::SpecificationReader.new(repository, mapper) }
    let(:specification) { RubyEventStore::Specification.new(reader) }

    it_behaves_like :event_repository, repository_class

    specify "#initialize requires ROM::Env" do
      expect{repository_class.new(rom: nil)}.to raise_error do |err|
        expect(err).to be_a(ArgumentError)
        expect(err.message).to eq("Must specify rom")
{'fraction_non_alphanumeric': 0.12084902430674427, 'fraction_numerical': 0.0, 'mean_word_length': 4.867469879518072, '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': '4629517', 'n_tokens_mistral': 942, 'n_tokens_neox': 915, 'n_words': 144}