Sha256: cceef368dce938b5759b5d2aa43eb9654f3ebf9b640bd6c4f42a7bdd9ad512ea

Contents?: true

Size: 717 Bytes

Versions: 103

Compression:

Stored size: 717 Bytes

Contents

module Awspec::Generator
  module Spec
    class Eip
      include Awspec::Helper::Finder
      def select_all_addresses
        res = ec2_client.describe_addresses
        res.addresses
      end

      def generate_all
        eips = select_all_addresses
        raise 'Not Found Elastic IP addresses.' if eips.empty?
        ERB.new(eip_spec_template, nil, '-').result(binding).chomp
      end

      def eip_spec_template
        template = <<-'EOF'
<% eips.each do |eip| %>
describe eip('<%= eip.public_ip %>') do
  it { should exist }
  it { should be_associated_to('<%= eip.instance_id %>') }
  it { should belong_to_domain('<%= eip.domain %>') }
end
<% end %>
EOF
        template
      end
    end
  end
end

Version data entries

103 entries across 103 versions & 4 rubygems

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