Sha256: 30d30c833e2f3a9f00fe5c0994522290bc62d3ccf90da49085340eda73c282cc

Contents?: true

Size: 1.6 KB

Versions: 1

Compression:

Stored size: 1.6 KB

Contents

#-------------------------------------------------------------------------
# Copyright (c) Microsoft. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#--------------------------------------------------------------------------
require "integration/test_helper"
require "azure/queue/queue_service"

describe Azure::Queue::QueueService do
  subject { Azure::Queue::QueueService.new }

  describe '#list_queues' do
    let(:queue_names){ [QueueNameHelper.name, QueueNameHelper.name] }
    before { queue_names.each { |q| subject.create_queue q } }
    after { QueueNameHelper.clean }
    
    it 'lists the available queues' do
      expected_queues = 0

      # An empty next marker means to start at the beginning
      next_marker = ''
      begin
        result = subject.list_queues( { :marker => next_marker } )
        result.each { |q|
          q.name.wont_be_nil
          q.url.wont_be_nil
          expected_queues += 1 if queue_names.include? q.name
        }

        next_marker = result.continuation_token
      end while next_marker != ''
      expected_queues.must_equal queue_names.length
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
azure-0.5.0 test/integration/queue/list_queues_test.rb