<commit_before><commit_msg>Test Queue.<commit_after>require_relative '../src/queue'

RSpec.describe(Queue) do

    before(:each) do
        @sut = Queue.new
    end

    it('queues a value to the queue') do
        [1, 2, 3].each { |item| @sut.queue!(item) }
    end

    it('dequeues a value from the queue') do
        expect(@sut.dequeue!).to be(nil)

        @sut.queue!(1)
        @sut.queue!(2)

        expect(@sut.dequeue!).to be(1)
        expect(@sut.dequeue!).to be(2)
    end

    it('returns the first element in the queue') do
        expect(@sut.peek).to be(nil)

        @sut.queue!(1)
        @sut.queue!(2)

        expect(@sut.peek).to be(1)
    end

    it('checks if the queue is empty') do
        expect(@sut.empty?).to be(true)

        @sut.queue!(1)

        expect(@sut.empty?).to be(false)
    end
end
{'fraction_non_alphanumeric': 0.158021712907117, 'fraction_numerical': 0.013268998793727383, 'mean_word_length': 2.155893536121673, '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': '6232232', 'n_tokens_mistral': 318, 'n_tokens_neox': 297, 'n_words': 68}