<commit_before><commit_msg>Add spec<commit_after># frozen_string_literal: true

require "rails_helper"

describe TrainingQueueTotalTime do
  describe "#initialize" do
    let(:skillqueues) { double }

    let(:character) { instance_double(Character, skillqueues: skillqueues) }

    subject { described_class.new(character.skillqueues) }

    its(:skillqueues) { should eq(skillqueues) }
  end

  describe "#total_time" do
    before { travel_to Time.zone.now }

    after { travel_back }

    let!(:character) { create(:character) }

    let!(:skillqueue1) do
      create(:skillqueue,
        character: character,
        start_date: Time.zone.now,
        finish_date: Time.zone.now + 1.hour)
    end

    let!(:skillqueue2) do
      create(:skillqueue,
        character: character,
        start_date: Time.zone.now + 1.hour,
        finish_date: Time.zone.now + 2.hour)
    end

    subject { described_class.new(character.skillqueues) }

    specify { expect(subject.total_time).to eq("2h") }
  end
end
{'fraction_non_alphanumeric': 0.11287128712871287, 'fraction_numerical': 0.005940594059405941, 'mean_word_length': 3.2838983050847457, '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': '7479548', 'n_tokens_mistral': 329, 'n_tokens_neox': 323, 'n_words': 64}