awspec 1.12.3 → 1.12.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '041964ce50cedf17352bafd32bc143f586f8ac3496c80732ccb44ffa30dac6cd'
4
- data.tar.gz: 8ba9b3557ea32878bdaf2023d778ef9f04bab50a8bf6d37b976c1b2fafa14055
3
+ metadata.gz: 8cbf742d6798a1af84303ae4e02b784f0315159edde20f42935c8dd6a94f8691
4
+ data.tar.gz: 72ff7241198823d08f65185d59d8cc47f45f56a0f97b37c542690796cd985eb5
5
5
  SHA512:
6
- metadata.gz: 45f7c9e672e463d7f2679bca302d75a3e369b156781c4dcc6da2d60849591f244f19d17df137dfd2392b55561dd733a8c091d9ced7f2c7e65499df9cd7ee3287
7
- data.tar.gz: 41eb787850fa0ede4a07966f4f1d0ce5a55dde05b8c695c83196f21d37b9e4a69676b48811e76916671ee56d8c887a7e2d0a81c833df2be6b0f8735e4e189009
6
+ metadata.gz: b5c305643fadbe181998b9345da1683a3d3ab8013dc57292adcceb73e375eb87a2f1c903946382bfc4b767520adb99be32bab05c136987a5795a8a4d39674d1f
7
+ data.tar.gz: d17b7c98cfc54324d54acee1abaedaa4494008a06fe4df25659ca57aeb22aab15e66bcc151a652dd007c55fa0dde47a9ad5860651a0ce5a6f24266cb771e81d6
@@ -60,6 +60,18 @@ describe sns_topic(topic_arn) do
60
60
  end
61
61
  ```
62
62
 
63
+ ### subscriptions
64
+
65
+ More like a helper method for fixtures. You could add any logic required to
66
+ identify a specific method.
67
+
68
+ ```ruby
69
+ let (:subscriber) do
70
+ all = subject.subscriptions
71
+ return all[0].to_s # keys are stored as symbols
72
+ end
73
+ ```
74
+
63
75
  ### include_subscribed
64
76
 
65
77
  ```ruby
@@ -68,6 +80,26 @@ describe sns_topic(topic_arn) do
68
80
  end
69
81
  ```
70
82
 
83
+ ### have_subscription
84
+
85
+ ```ruby
86
+ describe sns_topic(topic_arn) do
87
+ let(:subscription_arn) do
88
+ subscription_arn: subscribed, # this is required
89
+ end
90
+
91
+ describe '#subscribed' do
92
+ it do
93
+ should have_subscription(subscribed)
94
+ end
95
+ end
96
+ end
97
+ ```
98
+
99
+ An [automatic matcher](https://www.rubydoc.info/github/rspec/rspec-expectations/RSpec/Matchers) created due the predicate `has_subscription?` existing method of `Awspec::Type::SnsTopic` class.
100
+
101
+ It validates if a given AWS SNS ARN subscription exists in the SNS Topic.
102
+
71
103
  ### have_subscription_attributes
72
104
 
73
105
  ```ruby
@@ -2880,6 +2880,25 @@ end
2880
2880
 
2881
2881
  ### have_subscription
2882
2882
 
2883
+ ```ruby
2884
+ describe sns_topic(topic_arn) do
2885
+ let(:subscription_arn) do
2886
+ subscription_arn: subscribed, # this is required
2887
+ end
2888
+
2889
+ describe '#subscribed' do
2890
+ it do
2891
+ should have_subscription(subscribed)
2892
+ end
2893
+ end
2894
+ end
2895
+ ```
2896
+
2897
+ An [automatic matcher](https://www.rubydoc.info/github/rspec/rspec-expectations/RSpec/Matchers) created due the predicate `has_subscription?` existing method of `Awspec::Type::SnsTopic` class.
2898
+
2899
+ It validates if a given AWS SNS ARN subscription exists in the SNS Topic.
2900
+
2901
+
2883
2902
  ### have_subscription_attributes
2884
2903
 
2885
2904
  ```ruby
@@ -2936,6 +2955,8 @@ describe sqs('my-queue') do
2936
2955
  end
2937
2956
  ```
2938
2957
 
2958
+ ### have_tag
2959
+
2939
2960
  ### its(:queue_arn), its(:approximate_number_of_messages), its(:approximate_number_of_messages_not_visible), its(:approximate_number_of_messages_delayed), its(:created_timestamp), its(:last_modified_timestamp), its(:visibility_timeout), its(:maximum_message_size), its(:message_retention_period), its(:delay_seconds), its(:receive_message_wait_time_seconds), its(:queue_url)
2940
2961
  ## <a name="ssm_parameter">ssm_parameter</a>
2941
2962
 
@@ -8,7 +8,7 @@ module Awspec::Generator
8
8
  @type = Awspec::Type::SnsTopic.new('my-sns')
9
9
  @ret = @type.resource_via_client
10
10
  @matchers = %w(include_subscribed have_subscription_attributes)
11
- @ignore_matchers = []
11
+ @ignore_matchers = ['have_subscription_filter']
12
12
  @describes = %w(policy owner pending_subscriptions topic_arn effective_delivery_policy display_name
13
13
  confirmed_subscriptions deleted_subscriptions name)
14
14
  end
@@ -7,6 +7,11 @@ module Awspec::Helper
7
7
  end
8
8
  res.single_resource(queue_name)
9
9
  end
10
+
11
+ def find_tags_for_queue(queue_url)
12
+ res = sqs_client.list_queue_tags({ queue_url: queue_url })
13
+ res.tags
14
+ end
10
15
  end
11
16
  end
12
17
  end
@@ -20,6 +20,11 @@ Aws.config[:sqs] = {
20
20
  'DelaySeconds' => '0',
21
21
  'ReceiveMessageWaitTimeSeconds' => '0'
22
22
  }
23
+ },
24
+ list_queue_tags: {
25
+ tags: {
26
+ 'Name' => 'my-queue'
27
+ }
23
28
  }
24
29
  }
25
30
  }
@@ -8,6 +8,7 @@ module Awspec::Type
8
8
  end
9
9
 
10
10
  def subscriptions
11
+ fetch_subscriptions
11
12
  @subscriptions.keys
12
13
  end
13
14
 
@@ -27,5 +27,11 @@ module Awspec::Type
27
27
  super
28
28
  end
29
29
  end
30
+
31
+ def has_tag?(tag_key, tag_value)
32
+ @tag_set ||= find_tags_for_queue(@id)
33
+ return nil if @tag_set[tag_key] != tag_value
34
+ true
35
+ end
30
36
  end
31
37
  end
@@ -1,3 +1,3 @@
1
1
  module Awspec
2
- VERSION = '1.12.3'
2
+ VERSION = '1.12.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.3
4
+ version: 1.12.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - k1LoW
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-22 00:00:00.000000000 Z
11
+ date: 2018-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk