<commit_before>require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../fixtures/classes', __FILE__)

describe "Module#prepend" do
  it "is a public method" do
    Module.should have_public_instance_method(:prepend, true)
  end

  it "calls #prepend_features(self) in reversed order on each module" do
    ScratchPad.record []

    m = Module.new do
      def self.prepend_features(mod)
        ScratchPad << [ self, mod ]
      end
    end

    m2 = Module.new do
      def self.prepend_features(mod)<commit_msg>Specify `superclass` in respect to `prepend`<commit_after>require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../fixtures/classes', __FILE__)

describe "Module#prepend" do
  it "is a public method" do
    Module.should have_public_instance_method(:prepend, true)
  end

  it "does not affect the superclass" do
    Class.new { prepend Module.new }.superclass.should == Object
  end

  it "calls #prepend_features(self) in reversed order on each module" do
    ScratchPad.record []

    m = Module.new do
      def self.prepend_features(mod)
        ScratchPad << [ self, mod ]
      end
    end

    m2 = Module.new do
      def self.prepend_features(mod)
{'fraction_non_alphanumeric': 0.11038961038961038, 'fraction_numerical': 0.0016233766233766235, 'mean_word_length': 3.28125, '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': '2217317', 'n_tokens_mistral': 400, 'n_tokens_neox': 389, 'n_words': 107}