Sha256: 16c3be43a69cd81528dd03c175ac708b9e4feb8a05005450c2db669f955e6de4

Contents?: true

Size: 723 Bytes

Versions: 21

Compression:

Stored size: 723 Bytes

Contents

require 'spec_helper'

describe Docker::MessagesStack do

  describe '#append' do
    context 'without limits' do |variable|
      it 'does not limit stack size by default' do
        data = ['foo', 'bar']
        msg = Docker::Messages.new(data, [], data)
        expect(subject.messages).not_to receive(:shift)
        1000.times { subject.append(msg) }
      end
    end

    context 'with size limit' do
      let(:subject) { described_class.new(100) }

      it 'limits stack to given size' do
        data = ['foo', 'bar']
        msg = Docker::Messages.new(data, [], data)
        expect(subject.messages).to receive(:shift).exactly(1900).times
        1000.times { subject.append(msg) }
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
docker-api-1.31.0 spec/docker/messages_stack.rb
docker-api-1.30.2 spec/docker/messages_stack.rb
docker-api-1.30.1 spec/docker/messages_stack.rb
docker-api-1.30.0 spec/docker/messages_stack.rb
docker-api-1.29.2 spec/docker/messages_stack.rb
docker-api-1.29.1 spec/docker/messages_stack.rb
docker-api-1.29.0 spec/docker/messages_stack.rb
docker-api-1.28.0 spec/docker/messages_stack.rb
docker-api-1.27.0 spec/docker/messages_stack.rb
docker-api-1.26.2 spec/docker/messages_stack.rb
docker-api-1.26.1 spec/docker/messages_stack.rb
docker-api-1.26.0 spec/docker/messages_stack.rb
docker-api-1.25.0 spec/docker/messages_stack.rb
docker-api-1.24.1 spec/docker/messages_stack.rb
docker-api-1.24.0 spec/docker/messages_stack.rb
docker-api-1.23.0 spec/docker/messages_stack.rb
docker-api-1.22.4 spec/docker/messages_stack.rb
docker-api-1.22.3 spec/docker/messages_stack.rb
docker-api-1.22.2 spec/docker/messages_stack.rb
docker-api-1.22.1 spec/docker/messages_stack.rb