Sha256: 9c9b53620f5a0bb541748ddf6332a480f213d268d3c37137e68ab86e9eff1f93

Contents?: true

Size: 705 Bytes

Versions: 22

Compression:

Stored size: 705 Bytes

Contents

require 'spec_helper'

describe Infobar::FIFO do
  let :fifo do
    described_class.new(3)
  end

  it 'has max_size' do
    expect(fifo.max_size).to eq 3
  end

  it 'has size' do
    expect(fifo.size).to eq 0
    fifo << 1
    expect(fifo.size).to eq 1
  end

  it 'has size <= max_size' do
    fifo << 1 << 2 << 3 << 4
    expect(fifo.size).to eq 3
  end

  it 'can be added to' do
    fifo << 1 << 2
    expect(fifo.to_a).to eq [ 1, 2 ]
  end

  it 'can be empty' do
    expect(fifo).to be_empty
  end

  it 'can be non-empty' do
    fifo << 1
    expect(fifo).not_to be_empty
  end

  it 'can be cleared' do
    fifo << 1
    expect(fifo).not_to be_empty
    expect(fifo.clear).to be_empty
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
infobar-0.8.1 spec/infobar/fifo_spec.rb
infobar-0.8.0 spec/infobar/fifo_spec.rb
infobar-0.7.4 spec/infobar/fifo_spec.rb
infobar-0.7.2 spec/infobar/fifo_spec.rb
infobar-0.7.1 spec/infobar/fifo_spec.rb
infobar-0.7.0 spec/infobar/fifo_spec.rb
infobar-0.6.2 spec/infobar/fifo_spec.rb
infobar-0.6.1 spec/infobar/fifo_spec.rb
infobar-0.6.0 spec/infobar/fifo_spec.rb
infobar-0.5.1 spec/infobar/fifo_spec.rb
infobar-0.5.0 spec/infobar/fifo_spec.rb
infobar-0.4.0 spec/infobar/fifo_spec.rb
infobar-0.3.0 spec/infobar/fifo_spec.rb
infobar-0.2.0 spec/infobar/fifo_spec.rb
infobar-0.1.1 spec/infobar/fifo_spec.rb
infobar-0.1.0 spec/infobar/fifo_spec.rb
infobar-0.0.7 spec/infobar/fifo_spec.rb
infobar-0.0.6 spec/infobar/fifo_spec.rb
infobar-0.0.5 spec/infobar/fifo_spec.rb
infobar-0.0.4 spec/infobar/fifo_spec.rb