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

describe Changeling::Trackling do
  before(:all) do
    @klass = Changeling::Models::Logling
  end

  models.each_pair do |model, args|
    before(:each) do
      @object = model.new(args[:options])
    end

    describe "callbacks" do
      before(:each) do
        @changes = args[:changes]
      end

      it "should not create a logling when doing the initial save of a new object" do
        @klass.should_not_receive(:create)
        @object.save!
      end

      it "should create a logling with the changed attributes of an object when it is saved" do
        # Persist object to DB so we can update it.
        @object.save!

        @klass.should_receive(:create).with(@object, @changes)

        @changes.each_pair do |k, v|
          @object.send("#{k}=", v[1])
        end

        @object.save!
      end
    end

    describe "instance methods" do
    end
  end
end<commit_msg>Removed instance methods section from Trackling spec. This belongs in a different module.<commit_after>require (File.expand_path('../../../spec_helper', __FILE__))

describe Changeling::Trackling do
  before(:all) do
    @klass = Changeling::Models::Logling
  end

  models.each_pair do |model, args|
    before(:each) do
      @object = model.new(args[:options])
    end

    describe "callbacks" do
      before(:each) do
        @changes = args[:changes]
      end

      it "should not create a logling when doing the initial save of a new object" do
        @klass.should_not_receive(:create)
        @object.save!
      end

      it "should create a logling with the changed attributes of an object when it is saved" do
        # Persist object to DB so we can update it.
        @object.save!

        @klass.should_receive(:create).with(@object, @changes)

        @changes.each_pair do |k, v|
          @object.send("#{k}=", v[1])
        end

        @object.save!
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.10840932117527863, 'fraction_numerical': 0.0010131712259371835, 'mean_word_length': 2.4467713787085517, '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': '114207', 'n_tokens_mistral': 602, 'n_tokens_neox': 584, 'n_words': 192}