22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
# File 'lib/awspec/generator/spec/subnet.rb', line 22
def subnet_spec_template
template = <<-'EOF'
<%- if subnet_tag_name -%>
describe subnet('<%= subnet_tag_name %>') do
<%- else -%>
describe subnet('<%= subnet_id %>') do
<%- end -%>
it { should exist }
it { should be_<%= subnet.state %> }
it { should belong_to_vpc('<%= @vpc_tag_name %>') }
<% describes.each do |describe| %>
<%- if subnet.members.include?(describe.to_sym) && !subnet[describe.to_sym].nil? -%>
<%- if subnet[describe].is_a?(String) -%>
its(:<%= describe %>) { should eq '<%= subnet[describe] %>' }
<%- else -%>
its(:<%= describe %>) { should eq <%= subnet[describe] %> }
<%- end -%>
<%- end -%>
<% end %>
end
EOF
template
end
|