Sha256: 15ec85d0560f292df2c675617883c40beeb624b0cb6d28622f8a6a5b23e457fa

Contents?: true

Size: 1.62 KB

Versions: 79

Compression:

Stored size: 1.62 KB

Contents

Shindo.tests('AWS::SQS | message requests', ['aws']) do

  tests('success') do

    @queue_url = Fog::AWS[:sqs].create_queue('fog_message_tests').body['QueueUrl']

    send_message_format = AWS::SQS::Formats::BASIC.merge({
      'MessageId'         => String,
      'MD5OfMessageBody'  => String
    })

    tests("#send_message('#{@queue_url}', 'message')").formats(send_message_format) do
      Fog::AWS[:sqs].send_message(@queue_url, 'message').body
    end

    receive_message_format = AWS::SQS::Formats::BASIC.merge({
      'Message' => [{
        'Attributes'    => {
          'ApproximateFirstReceiveTimestamp'  => Time,
          'ApproximateReceiveCount'           => Integer,
          'SenderId'                          => String,
          'SentTimestamp'                     => Time
        },
        'Body'          => String,
        'MD5OfBody'     => String,
        'MessageId'     => String,
        'ReceiptHandle' => String
      }]
    })

    tests("#receive_message").formats(receive_message_format) do
      data = Fog::AWS[:sqs].receive_message(@queue_url).body
      @receipt_handle = data['Message'].first['ReceiptHandle']
      data
    end

    tests("#change_message_visibility('#{@queue_url}, '#{@receipt_handle}', 60)").formats(AWS::SQS::Formats::BASIC) do
      Fog::AWS[:sqs].change_message_visibility(@queue_url, @receipt_handle, 60).body
    end

    tests("#delete_message('#{@queue_url}', '#{@receipt_handle}')").formats(AWS::SQS::Formats::BASIC) do
      Fog::AWS[:sqs].delete_message(@queue_url, @receipt_handle).body
    end

    unless Fog.mocking?
      Fog::AWS[:sqs].delete_queue(@queue_url)
    end

  end

end

Version data entries

79 entries across 77 versions & 6 rubygems

Version Path
fog-aws-3.12.0 tests/requests/sqs/message_tests.rb
fog-aws-3.11.0 tests/requests/sqs/message_tests.rb
fog-aws-3.10.0 tests/requests/sqs/message_tests.rb
fog-aws-3.9.0 tests/requests/sqs/message_tests.rb
fog-aws-3.8.0 tests/requests/sqs/message_tests.rb
fog-aws-3.7.0 tests/requests/sqs/message_tests.rb
fog-aws-3.6.7 tests/requests/sqs/message_tests.rb
fog-aws-3.6.6 tests/requests/sqs/message_tests.rb
fog-aws-3.6.5 tests/requests/sqs/message_tests.rb
fog-aws-3.6.4 tests/requests/sqs/message_tests.rb
fog-aws-3.6.3 tests/requests/sqs/message_tests.rb
fog-aws-3.6.2 tests/requests/sqs/message_tests.rb
fog-aws-3.5.2 tests/requests/sqs/message_tests.rb
fog-aws-3.5.1 tests/requests/sqs/message_tests.rb
fog-aws-3.5.0 tests/requests/sqs/message_tests.rb
fog-aws-3.4.0 tests/requests/sqs/message_tests.rb
fog-aws-3.3.0 tests/requests/sqs/message_tests.rb
fog-aws-3.2.0 tests/requests/sqs/message_tests.rb
fog-aws-3.1.0 tests/requests/sqs/message_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-aws-2.0.1/tests/requests/sqs/message_tests.rb