Sha256: 15b2920a0bac803f49dfc6743010fbefce479cec5a37b13fa2959c71cf482dba

Contents?: true

Size: 1.35 KB

Versions: 68

Compression:

Stored size: 1.35 KB

Contents

require 'spec_helper'

class Convection::Model::Template
  describe '#validate_resources' do
    context 'with regular Resource name' do
      subject do
        Convection.template do
          description 'Validations Test Template - Regular Resource Name'

          resource 'Resource0'
        end
      end

      it 'raises an excessive resource name error' do
        rendered = subject.render
        expect { subject.validate(rendered) }.to_not raise_error
      end
    end

    context 'with excessive Resource name' do
      subject do
        Convection.template do
          description 'Validations Test Template - Excessive Resource Name'

          resource '0' * (CF_MAX_RESOURCE_NAME + 1)
        end
      end

      it 'raises an excessive resource name error' do
        rendered = subject.render
        expect { subject.validate(rendered) }.to raise_error(ExcessiveResourceNameError)
      end
    end

    context 'with excessive Resources' do
      subject do
        Convection.template do
          description 'Validations Test Template - Too Many Resources'

          (CF_MAX_RESOURCES + 1).times { |i| resource "TestResource#{i}" }
        end
      end

      it 'raises an excessive resources error' do
        rendered = subject.render
        expect { subject.validate(rendered) }.to raise_error(ExcessiveResourcesError)
      end
    end
  end
end

Version data entries

68 entries across 68 versions & 1 rubygems

Version Path
convection-2.3.1 spec/convection/model/template/validate_resources_spec.rb
convection-2.3.0 spec/convection/model/template/validate_resources_spec.rb
convection-2.2.29 spec/convection/model/template/validate_resources_spec.rb
convection-2.2.28.pre.beta.2 spec/convection/model/template/validate_resources_spec.rb
convection-2.2.28.pre.beta.1 spec/convection/model/template/validate_resources_spec.rb
convection-2.2.27 spec/convection/model/template/validate_resources_spec.rb
convection-2.2.26 spec/convection/model/template/validate_resources_spec.rb
convection-2.2.25 spec/convection/model/template/validate_resources_spec.rb
convection-2.2.24 spec/convection/model/template/validate_resources_spec.rb
convection-2.2.23 spec/convection/model/template/validate_resources_spec.rb
convection-2.2.22 spec/convection/model/template/validate_resources_spec.rb
convection-2.2.21 spec/convection/model/template/validate_resources_spec.rb
convection-2.2.20 spec/convection/model/template/validate_resources_spec.rb
convection-2.2.19 spec/convection/model/template/validate_resources_spec.rb
convection-2.2.18 spec/convection/model/template/validate_resources_spec.rb
convection-2.2.17 spec/convection/model/template/validate_resources_spec.rb
convection-2.2.16 spec/convection/model/template/validate_resources_spec.rb
convection-2.2.15 spec/convection/model/template/validate_resources_spec.rb
convection-2.2.14 spec/convection/model/template/validate_resources_spec.rb
convection-2.2.13 spec/convection/model/template/validate_resources_spec.rb