Sha256: 2543d509d834deedd7f4d8bc5dc2b9182bb194c2bba6c7c2a9d39c5baa4a8677

Contents?: true

Size: 898 Bytes

Versions: 10

Compression:

Stored size: 898 Bytes

Contents

require 'spec_helper'

class Convection::Model::Template
  describe Condition do
    let(:template) do
      Convection.template do
        description 'Condition Test Template'

        condition 'InProd' do
          fn_equals 'prod', 'prod'
        end

        resource 'SecurityGroup' do
          type 'AWS::EC2::SecurityGroup'
          condition 'InProd'
        end
      end
    end

    it 'can be referenced by resources' do
      resource = rendered_template
                 .fetch('Resources').fetch('SecurityGroup')
      expect(resource).to include('Condition' => 'InProd')
    end

    it 'can be referenced by resources' do
      resource = rendered_template
                 .fetch('Resources').fetch('SecurityGroup')
      expect(resource).to include('Condition' => 'InProd')
    end

    private

    def rendered_template
      JSON.parse(template.to_json)
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
convection-0.4.3 spec/convection/model/template/condition_spec.rb
convection-0.4.2 spec/convection/model/template/condition_spec.rb
convection-0.4.1 spec/convection/model/template/condition_spec.rb
convection-0.4.0 spec/convection/model/template/condition_spec.rb
convection-0.3.3.pre.beta.1 spec/convection/model/template/condition_spec.rb
convection-0.3.2 spec/convection/model/template/condition_spec.rb
convection-0.3.1 spec/convection/model/template/condition_spec.rb
convection-0.3.0 spec/convection/model/template/condition_spec.rb
convection-0.2.34.pre.beta.1 spec/convection/model/template/condition_spec.rb
convection-0.2.33 spec/convection/model/template/condition_spec.rb