Sha256: b1f6fe190b38e7bd739bd59394a1f41efae8c9684e3cfbbf61cda4fbec79b426

Contents?: true

Size: 1.13 KB

Versions: 181

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
        raise 'Not Found virtual_interfaces' if virtual_interfaces.empty?
        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

181 entries across 181 versions & 4 rubygems

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