<commit_before>require "../spec_helper"
require "random/secure"

module Franklin
  describe Item do
    subject { Item.new(id, title, author, format) }
    let(:id) { Random::Secure.hex }
    let(:title) { "Ender's Game" }
    let(:author) { "<NAME>" }
    let(:format) { "eBook" }

    it "has an id" do
      expect(subject.id).to eq(id)
    end

    it "has a title" do
      expect(subject.title).to eq(title)
    end

    it "has an author" do
      expect(subject.author).to eq(author)
    end

    it "has a format" do
      expect(subject.format).to eq(format)
    end

    it "can be compared to other items by value" do
      expect(subject).not_to eq(described_class.new(Random::Secure.hex, title, author, format))
      expect(subject).to eq(described_class.new(id, title, author, format))
    end
  end
end
<commit_msg>Use variables instead of let and subject<commit_after>require "../spec_helper"
require "random/secure"

module Franklin
  describe Item do
    title = "Ender's Game"
    author = "<NAME>"
    format = "eBook"

    it "has an id" do
      id = Random::Secure.hex
      subject = Item.new(id, title, author, format)

      subject.id.should eq(id)
    end

    it "has a title" do
      id = Random::Secure.hex
      subject = Item.new(id, title, author, format)

      subject.title.should eq(title)
    end

    it "has an author" do
      id = Random::Secure.hex
      subject = Item.new(id, title, author, format)


      subject.author.should eq(author)
    end

    it "has a format" do
      id = Random::Secure.hex
      subject = Item.new(id, title, author, format)

      subject.author.should eq(author)
    end

    it "can be compared to other items by value" do
      id = Random::Secure.hex
      subject = Item.new(id, title, author, format)

      subject.should_not eq(Item.new(Random::Secure.hex, title, author, format))
      subject.should eq(Item.new(id, title, author, format))
    end
  end
end

{'fraction_non_alphanumeric': 0.12057465366854797, 'fraction_numerical': 0.0, 'mean_word_length': 2.6792452830188678, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4120887', 'n_tokens_mistral': 646, 'n_tokens_neox': 625, 'n_words': 190}