<commit_before>module KiwiCRM describe EntityPool do

  before do
    ExamplePool.clear
  end

  describe '.<<' do

    it 'adds the passed object to the pool' do
      object = OpenStruct.new id: :object
      ExamplePool.find { |e| e.id == :object}.should be_nil
      ExamplePool << object
      ExamplePool.find { |e| e.id == :object}.should == object
    end

  end

  describe '.clear' do

    it 'clears the pool' do
      7.times { ExamplePool << OpenStruct.new(id: rand) }
      ExamplePool.to_a.size.should == 7
      ExamplePool.clear
      ExamplePool.to_a.size.should == 0
    end

  end

  describe '.find' do

    it 'returns the first object fulfilling the requirements' do
      ExamplePool << (fun  = OpenStruct.new id: :fun,  lang: 'Ruby')
      ExamplePool << (work = OpenStruct.new id: :work, lang: 'PHP')
      ExamplePool.find { |p| p.lang == 'Ruby' }.should == fun
      ExamplePool.find { |p| p.id   == :work  }.should == work
    end

  end

  describe '.id' do

    it 'returns the first object with the given id' do
      ExamplePool << (fun  = OpenStruct.new id: :fun)
      ExamplePool << (work = OpenStruct.new id: :work)
      ExamplePool.id(:fun).should == fun
      ExamplePool.id(:work).should == work
    end

  end

end end<commit_msg>EntityPool spec æsthetic fixes<commit_after>module KiwiCRM describe EntityPool do

  before do
    ExamplePool.clear
  end

  describe '.<<' do

    it 'adds the passed object to the pool' do
      object = OpenStruct.new id: :object
      ExamplePool.id(:object).should be_nil
      ExamplePool << object
      ExamplePool.id(:object).should == object
    end

  end

  describe '.clear' do

    it 'clears the pool' do
      7.times { ExampleEntity.new }
      ExamplePool.to_a.size.should == 7
      ExamplePool.clear
      ExamplePool.to_a.size.should == 0
    end

  end

  describe '.find' do

    it 'returns the first object fulfilling the requirements' do
      ExamplePool << (fun  = OpenStruct.new id: :fun,  lang: 'Ruby')
      ExamplePool << (work = OpenStruct.new id: :work, lang: 'PHP')
      ExamplePool.find { |p| p.lang == 'Ruby' }.should == fun
      ExamplePool.find { |p| p.id   == :work  }.should == work
    end

  end

  describe '.id' do

    it 'returns the first object with the given id' do
      ExamplePool << (fun  = OpenStruct.new id: :fun)
      ExamplePool << (work = OpenStruct.new id: :work)
      ExamplePool.id(:fun).should  == fun
      ExamplePool.id(:work).should == work
    end

  end

end end
{'fraction_non_alphanumeric': 0.11602870813397129, 'fraction_numerical': 0.0023923444976076554, 'mean_word_length': 2.5041899441340782, 'pattern_counts': {'":': 0, '<': 29, '<?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': '6323000', 'n_tokens_mistral': 824, 'n_tokens_neox': 779, 'n_words': 250}