<commit_before>require File.dirname(__FILE__) + '/spec_helper'

describe Resourceful::Base, ".made_resourceful" do
  before(:each) { Resourceful::Base.made_resourceful.replace [] }

  it "should store blocks when called with blocks and return them when called without a block" do
    5.times { Resourceful::Base.made_resourceful(&should_be_called) }
    Resourceful::Base.made_resourceful.each(&:call)
  end
end
<commit_msg>Fix a nasty test bug that caused the integration tests to fail under ill-defined circumstances.<commit_after>require File.dirname(__FILE__) + '/spec_helper'

describe Resourceful::Base, ".made_resourceful" do
  before(:all)  { @original_blocks = Resourceful::Base.made_resourceful.dup }
  before(:each) { Resourceful::Base.made_resourceful.replace [] }
  after(:all)   { Resourceful::Base.made_resourceful.replace @original_blocks }

  it "should store blocks when called with blocks and return them when called without a block" do
    5.times { Resourceful::Base.made_resourceful(&should_be_called) }
    Resourceful::Base.made_resourceful.each(&:call)
  end
end

{'fraction_non_alphanumeric': 0.1056985294117647, 'fraction_numerical': 0.001838235294117647, 'mean_word_length': 5.680981595092025, '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': '7202887', 'n_tokens_mistral': 316, 'n_tokens_neox': 311, 'n_words': 82}