<commit_before># encoding: utf-8

require 'gaddag'

describe GADDAG, '#find' do
  subject { GADDAG.new }

  context 'given that the words BREAK and AKIN are added' do
    before { subject.add('BREAK') }
    before { subject.add('AKIN') }

    context 'when searching for any word or substring that has not been added' do
      it 'returns an empty list' do
        expect(subject.find('ZOMBIES')).to be_empty
      end
    end

    context 'when searching for an empty substring' do
      let(:results) { subject.find('') }

      it 'yields all words that have been added' do
        expect(results).to eq(['BREAK', 'AKIN'])
      end
    end
<commit_msg>More consistent & descriptive spec description<commit_after># encoding: utf-8

require 'gaddag'

describe GADDAG, '#find' do
  subject { GADDAG.new }

  context 'given that the words BREAK and AKIN are added' do
    before { subject.add('BREAK') }
    before { subject.add('AKIN') }

    context 'when searching for any word or substring that has not been added' do
      it 'yields no results' do
        expect(subject.find('ZOMBIES')).to be_empty
      end
    end

    context 'when searching for an empty substring' do
      let(:results) { subject.find('') }

      it 'yields all words that have been added' do
        expect(results).to eq(['BREAK', 'AKIN'])
      end
    end

{'fraction_non_alphanumeric': 0.10365398956002983, 'fraction_numerical': 0.0014914243102162564, 'mean_word_length': 2.889855072463768, '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': '2336375', 'n_tokens_mistral': 429, 'n_tokens_neox': 405, 'n_words': 151}