Sha256: 2b57c750d190bb2eac7464c95c9d37042e02792c6c3587f4fe999d0432b03f8f

Contents?: true

Size: 1.3 KB

Versions: 44

Compression:

Stored size: 1.3 KB

Contents

Shindo.tests('Fog::Rackspace::Queues | claims', ['rackspace']) do

  service = Fog::Rackspace::Queues.new
  queue = service.queues.create({
    :name => "fog_queue_#{Time.now.to_i.to_s}",
  })
  queue.messages.create({
    :ttl => VALID_TTL,
    :body => { :random => :body }
  })
  params = {
    :ttl => VALID_TTL,
    :grace => VALID_GRACE
  }

  begin
    collection_tests(queue.claims, params)

    tests('creating claims when there are no messages') do

      before do
        #clear all message from queue
        queue.messages.all.each do |message|
          message.destroy
        end
      end

      tests("#create(#{params.inspect}) => with no messages does not show up in claim list") do
        returns(false) { queue.claims.create(params) }
        returns(true) { queue.claims.empty? }
      end
    end

    tests('create claims when there are messages') do

      before do
        queue.messages.create({
          :ttl => VALID_TTL,
          :body => { :random => :body }
        })
      end

      tests("#create(#{params.inspect}) => with messages does show up in claim list") do
        returns(true) do
          queue.claims.create(params).instance_of? Fog::Rackspace::Queues::Claim
        end
        returns(false) { queue.claims.empty? }
      end
    end
  ensure
    queue.destroy
  end
end

Version data entries

44 entries across 42 versions & 7 rubygems

Version Path
fog-rackspace-0.1.6 tests/rackspace/models/queues/claims_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-rackspace-0.1.5/tests/rackspace/models/queues/claims_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-rackspace-0.1.5/tests/rackspace/models/queues/claims_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-rackspace-0.1.5/tests/rackspace/models/queues/claims_tests.rb
fog-rackspace-0.1.5 tests/rackspace/models/queues/claims_tests.rb
fog-rackspace-0.1.4 tests/rackspace/models/queues/claims_tests.rb
fog-rackspace-0.1.3 tests/rackspace/models/queues/claims_tests.rb
fog-rackspace-0.1.2 tests/rackspace/models/queues/claims_tests.rb
fog-rackspace-0.1.1 tests/rackspace/models/queues/claims_tests.rb
fog-rackspace-0.1.0 tests/rackspace/models/queues/claims_tests.rb
fog-1.37.0 tests/rackspace/models/queues/claims_tests.rb
fog-1.36.0 tests/rackspace/models/queues/claims_tests.rb
fog-1.35.0 tests/rackspace/models/queues/claims_tests.rb
fog-2.0.0.pre.0 tests/rackspace/models/queues/claims_tests.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/tests/rackspace/models/queues/claims_tests.rb
fog-1.34.0 tests/rackspace/models/queues/claims_tests.rb
fog-1.33.0 tests/rackspace/models/queues/claims_tests.rb
fog-1.32.0 tests/rackspace/models/queues/claims_tests.rb
fog-1.31.0 tests/rackspace/models/queues/claims_tests.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/tests/rackspace/models/queues/claims_tests.rb