Sha256: a047d92c1beb099c3da9ea7268b6d150a3bbbdd92b1ebcf06ed35b595dcfcf19

Contents?: true

Size: 939 Bytes

Versions: 44

Compression:

Stored size: 939 Bytes

Contents

Shindo.tests('Fog::Rackspace::Queues | claim', ['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
    model_tests(queue.claims, params) do
      tests('#messages') do
        returns(1) { @instance.messages.length }
        returns('body') { @instance.messages.first.body['random'] }
      end

      tests('#update').succeeds do
        @instance.ttl = VALID_TTL + 5
        @instance.save
      end
    end

    queue.messages.create({
      :ttl => VALID_TTL,
      :body => { :random => :body }
    })
    tests('destroying claimed messages').succeeds do
      claim = queue.claims.create(params)
      claim.messages.first.destroy
    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/claim_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-rackspace-0.1.5/tests/rackspace/models/queues/claim_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-rackspace-0.1.5/tests/rackspace/models/queues/claim_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-rackspace-0.1.5/tests/rackspace/models/queues/claim_tests.rb
fog-rackspace-0.1.5 tests/rackspace/models/queues/claim_tests.rb
fog-rackspace-0.1.4 tests/rackspace/models/queues/claim_tests.rb
fog-rackspace-0.1.3 tests/rackspace/models/queues/claim_tests.rb
fog-rackspace-0.1.2 tests/rackspace/models/queues/claim_tests.rb
fog-rackspace-0.1.1 tests/rackspace/models/queues/claim_tests.rb
fog-rackspace-0.1.0 tests/rackspace/models/queues/claim_tests.rb
fog-1.37.0 tests/rackspace/models/queues/claim_tests.rb
fog-1.36.0 tests/rackspace/models/queues/claim_tests.rb
fog-1.35.0 tests/rackspace/models/queues/claim_tests.rb
fog-2.0.0.pre.0 tests/rackspace/models/queues/claim_tests.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/tests/rackspace/models/queues/claim_tests.rb
fog-1.34.0 tests/rackspace/models/queues/claim_tests.rb
fog-1.33.0 tests/rackspace/models/queues/claim_tests.rb
fog-1.32.0 tests/rackspace/models/queues/claim_tests.rb
fog-1.31.0 tests/rackspace/models/queues/claim_tests.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/tests/rackspace/models/queues/claim_tests.rb