<commit_before>require "active_support/core_ext/kernel"

warnings = capture(:stderr) do
  require "pundit"
  require "pundit/rspec"
end

unless warnings.to_s.empty?
  puts "ERROR: Encountered deprecation warning!"
  puts warnings
  exit 1
end

require "pry"
require "active_support/core_ext"
require "active_model/naming"

I18n.enforce_available_locales = false

module PunditSpecHelper
  extend RSpec::Matchers::DSL

  matcher :be_truthy do
    match do |actual|
      actual
    end
  end
end

RSpec.configure do |config|
  config.include PunditSpecHelper
end

class PostPolicy < Struct.new(:user, :post)
  def update?
    post.user == user
  end
  def destroy?
    false
  end
  def show?
    true
  end
end
class PostPolicy::Scope < Struct.new(:user, :scope)<commit_msg>Fix tests on ActiveSupport v4.2.x<commit_after>require "pundit"
require "pundit/rspec"

require "pry"
require "active_support"
require "active_support/core_ext"
require "active_model/naming"

I18n.enforce_available_locales = false

module PunditSpecHelper
  extend RSpec::Matchers::DSL

  matcher :be_truthy do
    match do |actual|
      actual
    end
  end
end

RSpec.configure do |config|
  config.include PunditSpecHelper
end

class PostPolicy < Struct.new(:user, :post)
  def update?
    post.user == user
  end
  def destroy?
    false
  end
  def show?
    true
  end
end
class PostPolicy::Scope < Struct.new(:user, :scope)
{'fraction_non_alphanumeric': 0.08612099644128114, 'fraction_numerical': 0.00498220640569395, 'mean_word_length': 4.021428571428571, 'pattern_counts': {'":': 0, '<': 7, '<?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': '3994941', 'n_tokens_mistral': 500, 'n_tokens_neox': 493, 'n_words': 131}