<commit_before>require 'lib/nif_generator'

describe "NifGenerator" do
  it "should validade a valid Nif" do
    valid_nif = '502874210'
    nif_generator = NifGenerator.instance
    result = NifGenerator.instance.validate(valid_nif)

    result.should == true    
  end
end<commit_msg>Refactor and add rspec tests<commit_after>require 'lib/nif_generator'

describe "NifGenerator" do
  it "should validate a valid nif" do
    valid_nif = '502874210'
    nif_generator = NifGenerator.instance
    result = nif_generator.validate(valid_nif)

    result.should == true    
  end

  it "should not validate an invalid nif" do
    invalid_nif = '502874211'
    nif_generator = NifGenerator.instance
    result = nif_generator.validate(invalid_nif)

    result.should == false    
  end
  
  it "should generate a valid nif" do
    nif_generator = NifGenerator.instance
    nif = nif_generator.generate
    result = nif_generator.validate(nif)

    result.should == true    
  end    
end
{'fraction_non_alphanumeric': 0.07331975560081466, 'fraction_numerical': 0.0274949083503055, 'mean_word_length': 3.4279279279279278, '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': '6053245', 'n_tokens_mistral': 343, 'n_tokens_neox': 320, 'n_words': 80}