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