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
cthiesfork-awspec-1.2.2 lib/awspec/matcher/have_subscription_attributes.rb
cthiesfork-awspec-1.2.1 lib/awspec/matcher/have_subscription_attributes.rb
awspec-1.18.5 lib/awspec/matcher/have_subscription_attributes.rb
cthiesfork-awspec-1.2.0 lib/awspec/matcher/have_subscription_attributes.rb
cthiesfork-awspec-1.1.0 lib/awspec/matcher/have_subscription_attributes.rb
cthiesfork-awspec-1.0.0 lib/awspec/matcher/have_subscription_attributes.rb
awspec-1.18.4 lib/awspec/matcher/have_subscription_attributes.rb
awspec-1.18.3 lib/awspec/matcher/have_subscription_attributes.rb
awspec-1.18.2 lib/awspec/matcher/have_subscription_attributes.rb
awspec-1.18.1 lib/awspec/matcher/have_subscription_attributes.rb
awspec-1.18.0 lib/awspec/matcher/have_subscription_attributes.rb
awspec-1.17.4 lib/awspec/matcher/have_subscription_attributes.rb
awspec-1.17.3 lib/awspec/matcher/have_subscription_attributes.rb
awspec-1.17.2 lib/awspec/matcher/have_subscription_attributes.rb
awspec-1.17.1 lib/awspec/matcher/have_subscription_attributes.rb
awspec-1.17.0 lib/awspec/matcher/have_subscription_attributes.rb
awspec-1.16.1 lib/awspec/matcher/have_subscription_attributes.rb
awspec-1.16.0 lib/awspec/matcher/have_subscription_attributes.rb
awspec-1.15.3 lib/awspec/matcher/have_subscription_attributes.rb
awspec-1.15.2 lib/awspec/matcher/have_subscription_attributes.rb