Sha256: cb54aa43c90a469f11993dd93940c45c2ecc2a7b5babddf0a9317e3a5cdfdd3f

Contents?: true

Size: 628 Bytes

Versions: 53

Compression:

Stored size: 628 Bytes

Contents

RSpec::Matchers.define :have_subscription_attributes do |expected_attribs|
  match do |sns_topic|
    unless expected_attribs.key?(:subscription_arn)
      raise '"subscription_arn" is the only required attribute to validate'
    end
    subscribed = sns_topic.subscribed(expected_attribs[:subscription_arn])
    temp = subscribed.to_h
    to_remove = temp.keys - expected_attribs.keys
    to_remove.each { |key| temp.delete(key) }
    temp == expected_attribs
  end

  failure_message do |sns_topic|
    "expected SNS topic #{sns_topic.name} to have a subscription with the following attributes: #{expected_attribs}"
  end
end

Version data entries

53 entries across 53 versions & 3 rubygems

Version Path
awspec-1.25.1 lib/awspec/matcher/have_subscription_attributes.rb
awspec-1.25.0 lib/awspec/matcher/have_subscription_attributes.rb
awspec-1.24.4 lib/awspec/matcher/have_subscription_attributes.rb
awspec-1.24.3 lib/awspec/matcher/have_subscription_attributes.rb
awspec-1.24.2 lib/awspec/matcher/have_subscription_attributes.rb
awspec-1.24.1 lib/awspec/matcher/have_subscription_attributes.rb
awspec-1.24.0 lib/awspec/matcher/have_subscription_attributes.rb
awspec-1.23.0 lib/awspec/matcher/have_subscription_attributes.rb
awspec-1.22.1 lib/awspec/matcher/have_subscription_attributes.rb
awspec-1.22.0 lib/awspec/matcher/have_subscription_attributes.rb
awspec-1.21.1 lib/awspec/matcher/have_subscription_attributes.rb
awspec-1.21.0 lib/awspec/matcher/have_subscription_attributes.rb
awspec-1.20.0 lib/awspec/matcher/have_subscription_attributes.rb
awspec-1.19.2 lib/awspec/matcher/have_subscription_attributes.rb
awspec-1.19.1 lib/awspec/matcher/have_subscription_attributes.rb
awspec-1.19.0 lib/awspec/matcher/have_subscription_attributes.rb
cthiesfork-awspec-1.2.4 lib/awspec/matcher/have_subscription_attributes.rb
awspec-api_gateway_extended-1.2.4 lib/awspec/matcher/have_subscription_attributes.rb
awspec-api_gateway_extended-1.2.3 lib/awspec/matcher/have_subscription_attributes.rb
awspec-1.18.6 lib/awspec/matcher/have_subscription_attributes.rb