Sha256: 1760ebd61de6c50b078aa110eafccee1f1ad6f53ade8a5a0ada3cee8fbe53905

Contents?: true

Size: 1.13 KB

Versions: 20

Compression:

Stored size: 1.13 KB

Contents

module Awspec::Generator
  module Spec
    class Directconnect
      include Awspec::Helper::Finder
      def generate_all
        generate_virtual_interface_all
      end

      def generate_virtual_interface_all
        virtual_interfaces = select_virtual_interfaces
        virtual_interfaces.empty? && fail('Not Found virtual_interfaces')
        ERB.new(virtual_interface_spec_template, nil, '-').result(binding).chomp
      end

      def virtual_interface_spec_template
        template = <<-'EOF'
<% virtual_interfaces.each do |interface| %>
describe directconnect_virtual_interface('<%= interface.virtual_interface_name %>') do
  it { should exist }
  it { should be_<%= interface.virtual_interface_state %> }
  its(:connection_id) { should eq '<%= interface.connection_id %>' }
  its(:virtual_interface_id) { should eq '<%= interface.virtual_interface_id %>' }
  its(:amazon_address) { should eq '<%= interface.amazon_address %>' }
  its(:customer_address) { should eq '<%= interface.customer_address %>' }
  its(:virtual_gateway_id) { should eq '<%= interface.virtual_gateway_id %>' }
end
<% end %>
EOF
        template
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
awspec-0.30.0 lib/awspec/generator/spec/directconnect.rb
awspec-0.29.0 lib/awspec/generator/spec/directconnect.rb
awspec-0.28.1 lib/awspec/generator/spec/directconnect.rb
awspec-0.28.0 lib/awspec/generator/spec/directconnect.rb
awspec-0.27.2 lib/awspec/generator/spec/directconnect.rb
awspec-0.27.1 lib/awspec/generator/spec/directconnect.rb
awspec-0.27.0 lib/awspec/generator/spec/directconnect.rb
awspec-0.26.2 lib/awspec/generator/spec/directconnect.rb
awspec-0.26.1 lib/awspec/generator/spec/directconnect.rb
awspec-0.26.0 lib/awspec/generator/spec/directconnect.rb
awspec-0.25.3 lib/awspec/generator/spec/directconnect.rb
awspec-0.25.2 lib/awspec/generator/spec/directconnect.rb
awspec-0.25.1 lib/awspec/generator/spec/directconnect.rb
awspec-0.25.0 lib/awspec/generator/spec/directconnect.rb
awspec-0.24.2 lib/awspec/generator/spec/directconnect.rb
awspec-0.24.1 lib/awspec/generator/spec/directconnect.rb
awspec-0.24.0 lib/awspec/generator/spec/directconnect.rb
awspec-0.23.0 lib/awspec/generator/spec/directconnect.rb
awspec-0.22.1 lib/awspec/generator/spec/directconnect.rb
awspec-0.22.0 lib/awspec/generator/spec/directconnect.rb