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-0.87.0 lib/awspec/generator/spec/eip.rb
awspec-0.86.0 lib/awspec/generator/spec/eip.rb
cmonson_2ndwatch_awspec-0.85.4 lib/awspec/generator/spec/eip.rb
awspec-0.85.3 lib/awspec/generator/spec/eip.rb
cmonson_2ndwatch_awspec-0.85.3 lib/awspec/generator/spec/eip.rb
awspec-0.85.2 lib/awspec/generator/spec/eip.rb
awspec-0.85.1 lib/awspec/generator/spec/eip.rb
awspec-0.85.0 lib/awspec/generator/spec/eip.rb
awspec-0.84.1 lib/awspec/generator/spec/eip.rb
awspec-0.84.0 lib/awspec/generator/spec/eip.rb
awspec-0.83.0 lib/awspec/generator/spec/eip.rb
awspec-0.82.3 lib/awspec/generator/spec/eip.rb
awspec-0.82.2 lib/awspec/generator/spec/eip.rb
awspec-0.82.1 lib/awspec/generator/spec/eip.rb
awspec-0.82.0 lib/awspec/generator/spec/eip.rb
awspec-0.81.1 lib/awspec/generator/spec/eip.rb
awspec-0.81.0 lib/awspec/generator/spec/eip.rb
awspec-0.80.1 lib/awspec/generator/spec/eip.rb
awspec-0.80.0 lib/awspec/generator/spec/eip.rb
awspec-0.79.2 lib/awspec/generator/spec/eip.rb