Sha256: f484aee092b3076d526b30f3789773fc4831d331bacc3a9b830d6a1772f2e0f4

Contents?: true

Size: 967 Bytes

Versions: 11

Compression:

Stored size: 967 Bytes

Contents

require 'fake_sqs/responder'
require 'active_support/core_ext/hash'
require 'verbose_hash_fetch'

describe FakeSQS::Responder do

  it "yields xml" do
    xml = subject.call :GetQueueUrl do |xml|
      xml.QueueUrl "example.com"
    end

    data = Hash.from_xml(xml)
    url = data.
      fetch("GetQueueUrlResponse").
      fetch("GetQueueUrlResult").
      fetch("QueueUrl")
    url.should eq "example.com"
  end

  it "skips result if no block is given" do
    xml = subject.call :DeleteQueue

    data = Hash.from_xml(xml)

    response = data.fetch("DeleteQueueResponse")
    response.should have_key("ResponseMetadata")
    response.should_not have_key("DeleteQueueResult")
  end

  it "has metadata" do
    xml = subject.call :GetQueueUrl do |xml|
    end

    data = Hash.from_xml(xml)

    request_id = data.
      fetch("GetQueueUrlResponse").
      fetch("ResponseMetadata").
      fetch("RequestId")

    request_id.should have(36).characters
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
fake_sqs-0.1.0 spec/unit/responder_spec.rb
fake_sqs-0.0.11 spec/unit/responder_spec.rb
fake_sqs-0.0.10 spec/unit/responder_spec.rb
fake_sqs-0.0.9 spec/unit/responder_spec.rb
fake_sqs-0.0.8 spec/unit/responder_spec.rb
fake_sqs-0.0.7 spec/unit/responder_spec.rb
fake_sqs-0.0.6 spec/unit/responder_spec.rb
fake_sqs-0.0.5 spec/unit/responder_spec.rb
fake_sqs-0.0.4 spec/unit/responder_spec.rb
fake_sqs-0.0.3 spec/unit/responder_spec.rb
fake_sqs-0.0.2 spec/unit/responder_spec.rb