<commit_before>require "spec_helper"

describe Openlogi::BaseObject do
  describe ".new" do
    it "issues warning about attributes not defined as properties on object" do
      expect_any_instance_of(Openlogi::BaseObject).to receive(:warn).once.with("foo is not a property of Openlogi::BaseObject and will be ignored.")
      object = Openlogi::BaseObject.new(foo: "bar")
    end
  end

  describe "#valid?" do
    it "returns true if object has no errors" do
      object = Openlogi::BaseObject.new(errors: {})
      expect(object.valid?).to eq(true)
    end

    it "returns false if object has errors" do
      object = Openlogi::BaseObject.new(errors: { "name" => [ "Already exist" ] })
      expect(object.valid?).to eq(false)
    end
  end
end<commit_msg>Use DummyObject with one property<commit_after>require "spec_helper"

class DummyObject < Openlogi::BaseObject
  property :bar
end

describe Openlogi::BaseObject do
  describe ".new" do
    it "issues warning about attributes not defined as properties on object" do
      expect_any_instance_of(DummyObject).to receive(:warn).once.with("foo is not a property of DummyObject and will be ignored.")
      object = DummyObject.new(foo: "foo", bar: "bar")
    end
  end

  describe "#valid?" do
    it "returns true if object has no errors" do
      object = Openlogi::BaseObject.new(errors: {})
      expect(object.valid?).to eq(true)
    end

    it "returns false if object has errors" do
      object = Openlogi::BaseObject.new(errors: { "name" => [ "Already exist" ] })
      expect(object.valid?).to eq(false)
    end
  end
end
{'fraction_non_alphanumeric': 0.10936517913262099, 'fraction_numerical': 0.0, 'mean_word_length': 3.641399416909621, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, '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': '5196060', 'n_tokens_mistral': 487, 'n_tokens_neox': 476, 'n_words': 155}