Sha256: 417244997d23ebcd3a611b3a03813f4e6211b8a226d93b963d7aaecb53c13084

Contents?: true

Size: 774 Bytes

Versions: 2

Compression:

Stored size: 774 Bytes

Contents

require "integration/test_helper"

describe "Fetching a Subscription by name" do
  before do
    @topic = Azure::ServiceBus::Topics.create(ServiceBusTopicNameHelper.name, {})
    @subscription = @topic.subscriptions.create("subscription-name")
  end

  after do
    ServiceBusTopicNameHelper.clean
  end

  it "can fetch a subscription by name" do
    subscription = @topic.subscriptions.fetch("subscription-name")
    assert subscription.valid?
  end

  it "can raises ArgumentError on missing subscriptions" do
    proc {
      @topic.subscriptions.fetch("nonexistent")
    }.must_raise ArgumentError
  end

  it "can handle errors in a different way" do
    error = @topic.subscriptions.fetch("nonexistant") { |err| err }
    error.must_be_kind_of Azure::Error
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
azure-0.1.1 test/integration/service_bus/subscriptions/fetch_subscription_test.rb
azure-0.1.0 test/integration/service_bus/subscriptions/fetch_subscription_test.rb