<commit_before># encoding: utf-8

require 'spec_helper'

describe RuboCop::Cop::Rails::Validation do
  subject(:cop) { described_class.new }

  described_class::BLACKLIST.each_with_index do |validation, number|
    it "registers an offense for #{validation}" do
      inspect_source(cop,
                     ["#{validation} :name"])
      expect(cop.offenses.size).to eq(1)
    end

    it "outputs the correct message for #{validation}" do
      inspect_source(cop,
                     ["#{validation} :name"])
      expect(cop.offenses.first.message).to include(described_class::WHITELIST[number])
    end
  end

  it 'accepts new style validations' do
    inspect_source(cop,
                   ['validates :name'])
    expect(cop.offenses).to be_empty
  end
end<commit_msg>Keep line length to 80<commit_after># encoding: utf-8

require 'spec_helper'

describe RuboCop::Cop::Rails::Validation do
  subject(:cop) { described_class.new }

  described_class::BLACKLIST.each_with_index do |validation, number|
    it "registers an offense for #{validation}" do
      inspect_source(cop,
                     ["#{validation} :name"])
      expect(cop.offenses.size).to eq(1)
    end

    it "outputs the correct message for #{validation}" do
      inspect_source(cop,
                     ["#{validation} :name"])
      expect(cop.offenses.first.message)
        .to include(described_class::WHITELIST[number])
    end
  end

  it 'accepts new style validations' do
    inspect_source(cop,
                   ['validates :name'])
    expect(cop.offenses).to be_empty
  end
end
{'fraction_non_alphanumeric': 0.11548223350253807, 'fraction_numerical': 0.0038071065989847717, 'mean_word_length': 2.9623115577889445, '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': '1874512', 'n_tokens_mistral': 482, 'n_tokens_neox': 473, 'n_words': 114}