<commit_before>require 'password_and_ordinals'

RSpec.describe PasswordAndOrdinals do
  describe '#characters' do
    subject { PasswordAndOrdinals.new('secret', [1, 2]).characters }

    it { should eq(%w(s e)) }
  end

  it 'raises error when not in ascending order' do
    expect {
      PasswordAndOrdinals.new('secret', [2, 1])
    }.to raise_error(ArgumentError).with_message('[2, 1] is not in ascending order')
  end

  describe 'duplicates' do
    context 'one ordinal duplicated' do
      it 'raises error when have duplicates' do
        expect {
          PasswordAndOrdinals.new('secret', [1, 1])
        }.to raise_error(ArgumentError).with_message('1 duplicated in [1, 1]')
      end
    end

    context 'two ordinals duplicated' do
      it 'raises error when have duplicates' do
        expect {
          PasswordAndOrdinals.new('secret', [1, 1, 2, 2])
        }.to raise_error(ArgumentError).with_message('1 and 2 duplicated in [1, 1, 2, 2]')
      end
    end

    context 'three ordinals duplicated' do
      it 'raises error when have duplicates' do
        expect {
          PasswordAndOrdinals.new('secret', [1, 1, 2, 2, 3, 3])
        }.to raise_error(ArgumentError).with_message('1, 2, and 3 duplicated in [1, 1, 2, 2, 3, 3]')<commit_msg>Change description<commit_after>require 'password_and_ordinals'

RSpec.describe PasswordAndOrdinals do
  describe '#characters' do
    subject { PasswordAndOrdinals.new('secret', [1, 2]).characters }

    it { should eq(%w(s e)) }
  end

  it 'raises error when not in ascending order' do
    expect {
      PasswordAndOrdinals.new('secret', [2, 1])
    }.to raise_error(ArgumentError).with_message('[2, 1] is not in ascending order')
  end

  describe 'duplicates' do
    context 'one ordinal duplicated' do
      it 'raises error' do
        expect {
          PasswordAndOrdinals.new('secret', [1, 1])
        }.to raise_error(ArgumentError).with_message('1 duplicated in [1, 1]')
      end
    end

    context 'two ordinals duplicated' do
      it 'raises error' do
        expect {
          PasswordAndOrdinals.new('secret', [1, 1, 2, 2])
        }.to raise_error(ArgumentError).with_message('1 and 2 duplicated in [1, 1, 2, 2]')
      end
    end

    context 'three ordinals duplicated' do
      it 'raises error' do
        expect {
          PasswordAndOrdinals.new('secret', [1, 1, 2, 2, 3, 3])
        }.to raise_error(ArgumentError).with_message('1, 2, and 3 duplicated in [1, 1, 2, 2, 3, 3]')
{'fraction_non_alphanumeric': 0.11812297734627832, 'fraction_numerical': 0.02912621359223301, 'mean_word_length': 2.944178628389155, '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': '910165', 'n_tokens_mistral': 867, 'n_tokens_neox': 762, 'n_words': 249}