Sha256: cfa0ce52e6ace6dd171965bc57cea900054069ce5b751d11b121891eb1e5b974

Contents?: true

Size: 608 Bytes

Versions: 10

Compression:

Stored size: 608 Bytes

Contents

require_relative 'test_helper'

describe Adrian::ArrayQueue do
  it 'should allow construction with an array' do
    q = Adrian::ArrayQueue.new([1,2,3])
    q.pop.value.must_equal 1
    q.pop.value.must_equal 2
    q.pop.value.must_equal 3
    q.pop.must_be_nil
  end

  it 'should allow construction without an array' do
    q = Adrian::ArrayQueue.new
    q.pop.must_be_nil
  end

  it 'should act as a queue' do
    q = Adrian::ArrayQueue.new

    q.push(1)
    q.push(2)
    q.push(3)

    q.pop.value.must_equal 1
    q.pop.value.must_equal 2
    q.pop.value.must_equal 3
    q.pop.must_be_nil
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
adrian-1.3.3 test/array_queue_test.rb
adrian-1.3.2 test/array_queue_test.rb
adrian-1.3.1 test/array_queue_test.rb
adrian-1.3.0 test/array_queue_test.rb
adrian-1.2.0 test/array_queue_test.rb
adrian-1.1.2 test/array_queue_test.rb
adrian-1.1.1 test/array_queue_test.rb
adrian-1.1.0 test/array_queue_test.rb
adrian-1.0.1 test/array_queue_test.rb
adrian-1.0.0 test/array_queue_test.rb