<commit_before>require 'spec_helper'

describe ContainerNumberValidator do

  context 'fails on nil and empty values' do
    it "with nil" do
      expect(subject.validate(nil)).to be_false
    end

    it "with empty string" do
      expect(subject.validate('')).to be_false
    end
  end

  context 'fails on invalid owner code and category indentifier' do
    %w{1CLU812975-4 TCLU81A975-4 TCLU81-975-4 T3LU812975-4}.each do |value|
      it "with #{value}" do
        expect(subject.validate(value)).to be_false
      end
    end
  end

  context 'fails on invalid checksum' do
    %w{TCLU812975-1 MOFU587008-2 DRYU413526-6 NYKU561651-8}.each do |value|
      it "with #{value}" do
        expect(subject.validate(value)).to be_false
      end
    end
  end

  context "passes on valid owner code and category identifier" do
    %w{MOFU587008-7 DRYU413526-5 NYKU644101-8 KKFU137865-2 NYKU561651-2 KKFU760143-9 TCLU250850-8}.each do |value|
      it "with #{value}" do
        expect(subject.validate(value)).to be_true
      end<commit_msg>Replace double quote with single quotes when you don't interpolate<commit_after>require 'spec_helper'

describe ContainerNumberValidator do

  context 'fails on nil and empty values' do
    it 'with nil' do
      expect(subject.validate(nil)).to be_false
    end

    it 'with empty string' do
      expect(subject.validate('')).to be_false
    end
  end

  context 'fails on invalid owner code and category indentifier' do
    %w{1CLU812975-4 TCLU81A975-4 TCLU81-975-4 T3LU812975-4}.each do |value|
      it "with #{value}" do
        expect(subject.validate(value)).to be_false
      end
    end
  end

  context 'fails on invalid checksum' do
    %w{TCLU812975-1 MOFU587008-2 DRYU413526-6 NYKU561651-8}.each do |value|
      it "with #{value}" do
        expect(subject.validate(value)).to be_false
      end
    end
  end

  context 'passes on valid owner code and category identifier' do
    %w{MOFU587008-7 DRYU413526-5 NYKU644101-8 KKFU137865-2 NYKU561651-2 KKFU760143-9 TCLU250850-8}.each do |value|
      it "with #{value}" do
        expect(subject.validate(value)).to be_true
      end
{'fraction_non_alphanumeric': 0.09209911173445536, 'fraction_numerical': 0.09817671809256662, 'mean_word_length': 3.0839694656488548, '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': '375150', 'n_tokens_mistral': 858, 'n_tokens_neox': 743, 'n_words': 210}