<commit_before>require 'stubba/stubba'

class Test::Unit::TestCase
    
  def self.method_added(method)
    # disable until we finish messing about
  end
  
  def setup_with_stubba
    $stubba = Stubba::Stubba.new
  end
  
  def teardown_with_stubba
    $stubba.unstub_all
    $stubba = nil
  end

  if method_defined?(:setup) then
    alias_method :setup_pre_stubba, :setup
    define_method(:setup_post_stubba) do
      setup_pre_stubba
      setup_with_stubba
    end
  else
    define_method(:setup_post_stubba) do
      setup_with_stubba
    end<commit_msg>Change suggested by <NAME> so that Stubba plays nicely with RSpec.<commit_after>require 'stubba/stubba'

class Test::Unit::TestCase
    
  def self.method_added(method)
    # disable until we finish messing about
  end
  
  def setup_with_stubba
    $stubba = Stubba::Stubba.new
  end
  
  def teardown_with_stubba
    return unless $stubba
    $stubba.unstub_all
    $stubba = nil
  end

  if method_defined?(:setup) then
    alias_method :setup_pre_stubba, :setup
    define_method(:setup_post_stubba) do
      setup_pre_stubba
      setup_with_stubba
    end
  else
    define_method(:setup_post_stubba) do
      setup_with_stubba
    end
{'fraction_non_alphanumeric': 0.06317539484621779, 'fraction_numerical': 0.0, 'mean_word_length': 3.3465703971119134, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '7355792', 'n_tokens_mistral': 421, 'n_tokens_neox': 449, 'n_words': 92}