Sha256: 074aeec38c32c604b726239b024b43c64be46c23555abbbe7bcab4f83e7ce397

Contents?: true

Size: 941 Bytes

Versions: 20

Compression:

Stored size: 941 Bytes

Contents

require 'spec_helper'

describe Analytical::CommandStore do
  
  describe 'when behaving exactly like an array' do
    it 'should add elements' do
      @store = Analytical::CommandStore.new ['a']
      @store << 'b'
      @store.commands.should == ['a', 'b']
    end
    it 'should unshift elements' do
      @store = Analytical::CommandStore.new ['b']
      @store.unshift 'a'
      @store.commands.should == ['a', 'b']
    end
    it 'should iterate over elements' do
      @store = Analytical::CommandStore.new ['a', 'b']
      @store.each do |elem|
        ['a', 'b'].include?(elem).should be_true
      end
    end
    it 'should have size' do
      @store = Analytical::CommandStore.new ['a', 'b']
      @store.size.should == 2
    end
  end
  
  describe 'when flushing' do
    it 'should empty the list' do
      @store = Analytical::CommandStore.new ['a', 'b']
      @store.flush
      @store.size.should == 0
    end
  end
  
end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
analytical-3.0.8 spec/analytical/command_store_spec.rb
analytical-3.0.7 spec/analytical/command_store_spec.rb
analytical-3.0.6 spec/analytical/command_store_spec.rb
gsiener-analytical-2.10.2 spec/analytical/command_store_spec.rb
gsiener-analytical-2.10.1 spec/analytical/command_store_spec.rb
analytical-2.11.0 spec/analytical/command_store_spec.rb
analytical-2.10.0 spec/analytical/command_store_spec.rb
gsiener-analytical-2.10.0 spec/analytical/command_store_spec.rb
analytical-2.9.0 spec/analytical/command_store_spec.rb
analytical-2.8.0 spec/analytical/command_store_spec.rb
analytical-2.7.2 spec/analytical/command_store_spec.rb
analytical-2.7.1 spec/analytical/command_store_spec.rb
analytical-2.7.0 spec/analytical/command_store_spec.rb
analytical-2.6.0 spec/analytical/command_store_spec.rb
analytical-2.5.0 spec/analytical/command_store_spec.rb
analytical-2.4.0 spec/analytical/command_store_spec.rb
analytical-2.3.0 spec/analytical/command_store_spec.rb
analytical-2.2.0 spec/analytical/command_store_spec.rb
analytical-2.1.0 spec/analytical/command_store_spec.rb
analytical-2.0.0 spec/analytical/command_store_spec.rb