awspec 0.66.2 → 0.67.0

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
  SHA1:
3
- metadata.gz: bc562d4bfd2115c6e7779ed32efeede89b4eebbf
4
- data.tar.gz: 5f03c09ed9aa2f1f277f3d251111c8125250d20a
3
+ metadata.gz: 9b3ee53234c845c3c8b2f13c13285071f3e02a48
4
+ data.tar.gz: 8c24b03a7cbdd93ce3474657b1a2a2d12294105d
5
5
  SHA512:
6
- metadata.gz: 75dd970023422a84e39eeaf08b5730a8137a5efe2c7f5e1cbd9f7bc614f8cb8e866d16250c23073892bdee7043acdd606fc2a0f51e8c228cc25c99cd35490a7f
7
- data.tar.gz: 8f9ccb0be0e2742411e91a0e630422424f0fe1857769b95337f866e2f1af59a5862c0dcf66f12cf2292600eac270b4d5a4be09d6fc8b35758fc718ac926bb10b
6
+ metadata.gz: 118dbace4fd900f4b5313695c20d0ee34d424fc2a08ee8b9a0ad1771bbba13027bf42a2a0b7eba42be47c0e8184e410a05135bd5ed3efd3c6a738e63518a85ef
7
+ data.tar.gz: f8e65b37f6af5b280d2a7a6459f6355add55ea49f2e6886efe38dc9b9207005d0b4642d1cddea33cdbe5b9fb9a677f35a1f71f9fda63d58c3248a4058432db69
@@ -39,6 +39,14 @@ describe rds('my-rds') do
39
39
  end
40
40
  ```
41
41
 
42
+ ### have_tag
43
+
44
+ ```ruby
45
+ describe rds('my-rds') do
46
+ it { should have_tag('Name').value('my-rds') }
47
+ end
48
+ ```
49
+
42
50
  ### belong_to_db_subnet_group
43
51
 
44
52
  ```ruby
@@ -1445,6 +1445,15 @@ end
1445
1445
  ```
1446
1446
 
1447
1447
 
1448
+ ### have_tag
1449
+
1450
+ ```ruby
1451
+ describe rds('my-rds') do
1452
+ it { should have_tag('Name').value('my-rds') }
1453
+ end
1454
+ ```
1455
+
1456
+
1448
1457
  ### belong_to_db_subnet_group
1449
1458
 
1450
1459
  ```ruby
@@ -18,7 +18,7 @@ module Awspec::Helper
18
18
  res.file_systems.single_resource(id)
19
19
  end
20
20
 
21
- def find_tags(id, tag_key)
21
+ def find_efs_tags(id, tag_key)
22
22
  begin
23
23
  tag_set = efs_client.describe_tags({ file_system_id: id })
24
24
  rescue
@@ -1,9 +1,18 @@
1
1
  Aws.config[:rds] = {
2
2
  stub_responses: {
3
+ list_tags_for_resource: {
4
+ tag_list: [
5
+ {
6
+ key: 'Name',
7
+ value: 'my-rds'
8
+ }
9
+ ]
10
+ },
3
11
  describe_db_instances: {
4
12
  db_instances: [
5
13
  {
6
14
  db_instance_identifier: 'my-rds',
15
+ db_instance_arn: 'arn:aws:rds:ap-northeast-1a:123456789012:db:my-rds',
7
16
  db_instance_status: 'available',
8
17
  db_instance_class: 'db.t2.medium',
9
18
  vpc_security_groups: [
@@ -14,7 +14,7 @@ module Awspec::Type
14
14
  end
15
15
 
16
16
  def has_tag?(tag_key, tag_value)
17
- tag = find_tags(@display_name, tag_key)
17
+ tag = find_efs_tags(@display_name, tag_key)
18
18
  return nil if tag.value != tag_value
19
19
  tag
20
20
  end
@@ -51,6 +51,14 @@ module Awspec::Type
51
51
  end
52
52
  end
53
53
 
54
+ def has_tag?(tag_key, tag_value)
55
+ arn = resource_via_client.db_instance_arn
56
+ tag_set = rds_client.list_tags_for_resource({ resource_name: arn })
57
+ tag_set.tag_list.find do |tag|
58
+ tag.key == tag_key && tag.value == tag_value
59
+ end
60
+ end
61
+
54
62
  private
55
63
 
56
64
  def has_vpc_security_group_id?(sg_id)
@@ -1,3 +1,3 @@
1
1
  module Awspec
2
- VERSION = '0.66.2'
2
+ VERSION = '0.67.0'
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: 0.66.2
4
+ version: 0.67.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - k1LoW
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-02-20 00:00:00.000000000 Z
11
+ date: 2017-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec