Sha256: be38c4cbaf39bd688a757fe53c3c7c833b6ff7495ed09237225b3fc9d35005e3

Contents?: true

Size: 960 Bytes

Versions: 26

Compression:

Stored size: 960 Bytes

Contents

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

  service = Fog::Rackspace::Queues.new
  options = {
    :name => "fog_instance_#{Time.now.to_i.to_s}",
  }
  model_tests(service.queues, options) do

    tests('#stats').formats(QUEUE_STATS_FORMAT['messages']) do
      @instance.stats
    end

    tests('#enqueue("msg", 60)') do
      @instance.enqueue("msg", 60)
    end

    tests('#dequeue(60, 60)').returns(true) do
      @instance.dequeue(60, 60) do |message|
        returns("msg") { message.body }
      end
    end

    tests('#dequeue(60, 60) => with not messages').returns(false) do
      @instance.dequeue(60, 60) do |message|
      end
    end

    tests('#dequeue(60, 60) => not passing block').returns(true) do
      @instance.enqueue("msg", 60)
      @instance.dequeue(60, 60)
    end

    tests('#dequeue(60, 60) => with not messages and not passing block').returns(false) do
      @instance.dequeue(60, 60)
    end
  end
end

Version data entries

26 entries across 24 versions & 5 rubygems

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