text: var should = require('should')
    , assert = require('assert')
    , expect = require('expect.js')
    , fixedQueue = require('../index.js').FixedQueue
  
  describe('FixedQueue', function(){
    describe('.push()', function(){
      it('should append a value', function(){
        var arr = fixedQueue(10, []);
        arr.push('foo');
        arr.push('bar');
        expect(arr[0]).to.equal('foo');
        expect(arr[1]).to.equal('bar');
      })
  
      it('should return the length', function(){
        var arr = fixedQueue(10, []);
        var n = arr.push('foo');
        expect(n).to.equal(1);
        var n = arr.push('bar');
        expect(n).to.equal(2);
      })
  
      it('should comply with permittedAmount restriction', function(){
        var arr = fixedQueue(4, []);;
        arr.push('1');
        arr.push('2');
        arr.push('3');
        arr.push('4');
        arr.push('5');
        arr.push('6');
        arr.push('7');
        arr.push('8');
        expect(arr.length).to.equal(arr.permittedAmount);
        // expect(arr[1]).to.equal('bar');
      })
  
      it('should remove excess queue members from the front of the queue', function(){
        var arr = fixedQueue(4, []);;
        arr.push('1');
        arr.push('2');
        arr.push('3');
        arr.push('4');
        arr.push('5');
        arr.push('6');
        arr.push('7');
        arr.push('8');
        expect(parseInt(arr[0])).to.equal(5);
      })
    })
  });