Method: Awspec::Generator::Spec::NetworkInterface#generate_subnet_spec

Defined in:
lib/awspec/generator/spec/network_interface.rb

#generate_subnet_spec(interface) ⇒ Object



36
37
38
39
40
41
42
43
44
45
# File 'lib/awspec/generator/spec/network_interface.rb', line 36

def generate_subnet_spec(interface)
  return unless interface.subnet_id
  subnet = find_subnet(interface.subnet_id)
  subnet_spec = if subnet.tag_name
                  "it { should belong_to_subnet('#{subnet.tag_name}') }"
                else
                  "it { should belong_to_subnet('#{subnet.subnet_id}') }"
                end
  subnet_spec
end