awspec 0.75.1 → 0.75.2

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: 49fe94ffa30e6b9c92023146cd85c521aceff9e2
4
- data.tar.gz: 179a8c1ce8704c773a939256ae6d9236e0ede141
3
+ metadata.gz: cc2c82413eb3cee4c14e3d2c01f2644a83ea17db
4
+ data.tar.gz: b00e6c88ee1b8744d6f043ad87cb7f0c376321ba
5
5
  SHA512:
6
- metadata.gz: a1e86efde98bdfac2803b68190fd244be251d51b623170d5369a7d1666cb5e6ff6077b1a301e7369c7be7a56655eebb3681d3fc02dfa13c1a13e5a0952c7612b
7
- data.tar.gz: 666058aa1d1c028f5585fe798e4920010365d4fa74437b995072044c555bd3a760803308cdd9d8ff9d3264ac727ecef52760fc84b137d491389e6fd84aa83a46
6
+ metadata.gz: 92e63018b98c2be4d8a25bec3b1521783125c98d0f68aaafd046157c16b108299b6a4fa8ffcf2488ec4e3e6669cb1f4b575fe090f106845829716caa129d99b0
7
+ data.tar.gz: fd61c7868686629a9f1da1c31f1a89ce5a3cd2111e74a32d8a02f1e9e07041d880ebae81401afbe8bf7a744a1faaa89e8475bf6a58f54890eea20d0dc6c2a7b1
@@ -26,6 +26,7 @@ require 'awspec/generator/spec/acm'
26
26
  require 'awspec/generator/spec/cloudwatch_logs'
27
27
  require 'awspec/generator/spec/alb'
28
28
  require 'awspec/generator/spec/internet_gateway'
29
+ require 'awspec/generator/spec/elasticsearch'
29
30
 
30
31
  # Doc
31
32
  require 'awspec/generator/doc/type'
@@ -1,35 +1,38 @@
1
1
  module Awspec::Generator
2
2
  module Spec
3
- class ElasticSearch
3
+ class Elasticsearch
4
4
  include Awspec::Helper::Finder
5
5
  def generate_all
6
6
  domains = select_all_elasticsearch_domains
7
- raise 'Not Found Domain' if events.empty?
8
- ERB.new(domain_spec_template, nil, '-').result(binding).chomp
7
+ raise 'Not Found Domain' if domains.empty?
8
+ ERB.new(domain_spec_template, nil, '-').result(binding).gsub(/^\n/, '')
9
9
  end
10
10
 
11
11
  def domain_spec_template
12
12
  template = <<-'EOF'
13
- <% domain.each do |domain| %>
14
- describe elasticsearch('<%= domain.domain_name %>') do
13
+ <% domains.each do |domain| %>
14
+ describe elasticsearch('<%= domain.domain_status.domain_name %>') do
15
15
  it { should exist }
16
- <% if domain.ebs_options.created %>
16
+ <% if domain.domain_status.created %>
17
17
  it { should be_created }
18
- <% end %>
19
- <% if domain.ebs_options.deleted %>
18
+ <% end %>
19
+ <% if domain.domain_status.deleted %>
20
20
  it { should be_deleted }
21
- <% end %>
22
- its(:elasticsearch_version) { should eq <%= domain.elasticsearch_version %> }
23
- its('elasticsearch_cluster_config.instance_type') { should eq <%= domain.elasticsearch_cluster_config.instance_type %> }
24
- its('ebs_options.ebs_enabled') { should eq <%= domain.ebs_options.ebs_enabled %> }
25
- <% if domain.ebs_options.ebs_enabled %>
26
- its('ebs_options.volume_type') { should eq <%= domain.ebs_options.ebs_volume_type %> }
27
- its('ebs_options.volume_size') { should eq <%= domain.ebs_options.ebs_volume_size %> }
28
- <% end %>
21
+ <% end %>
22
+ its(:elasticsearch_version) { should eq '<%= domain.domain_status.elasticsearch_version %>' }
23
+ its('elasticsearch_cluster_config.instance_type') { should eq '<%= domain.domain_status.elasticsearch_cluster_config.instance_type %>' }
24
+ its('ebs_options.ebs_enabled') { should eq <%= domain.domain_status.ebs_options.ebs_enabled %> }
25
+ <% if domain.domain_status.ebs_options.ebs_enabled -%>
26
+ its('ebs_options.volume_type') { should eq '<%= domain.domain_status.ebs_options.volume_type %>' }
27
+ its('ebs_options.volume_size') { should eq <%= domain.domain_status.ebs_options.volume_size %> }
28
+ <% end %>
29
29
  it do
30
30
  should have_access_policies <<-policy
31
- <%= JSON.pretty_generate(JSON.load(domain.access_policies)) %>
31
+ <%= JSON.pretty_generate(JSON.load(domain.domain_status.access_policies)) %>
32
32
  policy
33
+ end
34
+ end
35
+ <% end %>
33
36
  EOF
34
37
  template
35
38
  end
@@ -9,9 +9,9 @@ module Awspec::Helper
9
9
  end
10
10
 
11
11
  def select_all_elasticsearch_domains
12
- domain_names = elastisearch_client.list_domain_names
13
- domain_names.map do |domain_name|
14
- elasticsearch_client.describe_elasticsearch_domain(domain_name)
12
+ domain_names = elasticsearch_client.list_domain_names.domain_names
13
+ domain_names.map do |domain|
14
+ elasticsearch_client.describe_elasticsearch_domain(domain_name: domain.domain_name)
15
15
  end
16
16
  end
17
17
  end
@@ -1,3 +1,3 @@
1
1
  module Awspec
2
- VERSION = '0.75.1'
2
+ VERSION = '0.75.2'
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.75.1
4
+ version: 0.75.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - k1LoW
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-04-12 00:00:00.000000000 Z
11
+ date: 2017-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec