Sha256: 57d1dcc03108ae14f893c7978f4299d3922de98117867cd395a34ff6d0fefbf7
Contents?: true
Size: 1.21 KB
Versions: 4
Compression:
Stored size: 1.21 KB
Contents
# frozen_string_literal: true require 'spec_helper' describe CfnDsl::CloudFormationTemplate do subject(:template) { described_class.new } describe '#Nested_Arrays' do it 'ensure nested arrays are not duplicated' do template.DirectoryService_SimpleAD(:Test) do VpcSettings do SubnetId %w[subnet-a subnet-b] end end puts template.to_json expect(template.to_json).to include('"SubnetIds":["subnet-a","subnet-b"]}') expect(template.to_json).not_to include('"SubnetIds":[["subnet-a","subnet-b"],["subnet-a","subnet-b"]]') end it 'check multiple invocations work' do template.DirectoryService_SimpleAD(:Test) do VpcSettings do SubnetId 'subnet-a' SubnetId 'subnet-b' end end expect(template.to_json).to include('"SubnetIds":["subnet-a","subnet-b"]}') end it 'check multiple invocation with arrays works' do template.DirectoryService_SimpleAD(:Test) do VpcSettings do SubnetId %w[subnet-a subnet-b] SubnetId %w[subnet-c subnet-d] end end expect(template.to_json).to include('"SubnetIds":["subnet-a","subnet-b","subnet-c","subnet-d"]') end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
cfndsl-0.17.4 | spec/aws/nested_arrays_spec.rb |
cfndsl-0.17.3 | spec/aws/nested_arrays_spec.rb |
cfndsl-0.17.2 | spec/aws/nested_arrays_spec.rb |
cfndsl-0.17.1 | spec/aws/nested_arrays_spec.rb |