<commit_before># -*- encoding : utf-8 -*-
require "#{File.expand_path(File.dirname(__FILE__))}/spec_helper"
require "validates_email_format_of"

describe ValidatesEmailFormatOf do
  before(:all) do
    described_class.load_i18n_locales
    I18n.enforce_available_locales = false
  end
  subject do |example|
    if defined?(ActiveModel)
      user = Class.new do
        def initialize(email)
          @email = email.freeze
        end
        attr_reader :email
        include ActiveModel::Validations
        validates_email_format_of :email, example.example_group_instance.options
      end
      example.example_group_instance.class::User = user
      user.new(example.example_group_instance.email).tap(&:valid?).errors.full_messages
    else
      ValidatesEmailFormatOf::validate_email_format(email.freeze, options)
    end
  end
  let(:options) { {} }
  let(:email) { |example| example.example_group.description }
  describe "<EMAIL>" do
    it { should_not have_errors_on_email }
  end

  shared_examples_for :all_specs do
    [
      '<EMAIL>',
      '<EMAIL>',
      '<EMAIL>',
      '<EMAIL>',<commit_msg>removed POC spec now that all tests have been moved to spec<commit_after># -*- encoding : utf-8 -*-
require "#{File.expand_path(File.dirname(__FILE__))}/spec_helper"
require "validates_email_format_of"

describe ValidatesEmailFormatOf do
  before(:all) do
    described_class.load_i18n_locales
    I18n.enforce_available_locales = false
  end
  subject do |example|
    if defined?(ActiveModel)
      user = Class.new do
        def initialize(email)
          @email = email.freeze
        end
        attr_reader :email
        include ActiveModel::Validations
        validates_email_format_of :email, example.example_group_instance.options
      end
      example.example_group_instance.class::User = user
      user.new(example.example_group_instance.email).tap(&:valid?).errors.full_messages
    else
      ValidatesEmailFormatOf::validate_email_format(email.freeze, options)
    end
  end
  let(:options) { {} }
  let(:email) { |example| example.example_group.description }

  shared_examples_for :all_specs do
    [
      '<EMAIL>',
      '<EMAIL>',
      '<EMAIL>',
      '<EMAIL>',
{'fraction_non_alphanumeric': 0.10502489814395655, 'fraction_numerical': 0.004526935264825713, 'mean_word_length': 3.393638170974155, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, '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': '916698', 'n_tokens_mistral': 689, 'n_tokens_neox': 693, 'n_words': 129}