Sha256: 3043d38cd08b5c3b32dbf691284c3a7e6478e81fd59912b8e6b2906849e4c821

Contents?: true

Size: 1.36 KB

Versions: 67

Compression:

Stored size: 1.36 KB

Contents

require 'spec_helper'

class Convection::Model::Template::Resource
  describe EC2DHCPOptions do
    let(:template) do
      Convection.template do
        ec2_dhcp_options 'TestOptions' do
          domain_name 'example.com'
          domain_name_servers  '10.0.0.1', '10.0.0.2'
          netbios_name_servers '10.0.0.1', '10.0.0.2'
          netbios_node_type 1
          ntp_servers '10.0.0.1', '10.0.0.2'
          tag 'Name', 'Test'
        end
      end
    end

    subject do
      template_json
        .fetch('Resources')
        .fetch('TestOptions')
        .fetch('Properties')
    end

    it 'sets the DomainName' do
      expect(subject['DomainName']).to eq('example.com')
    end

    it 'sets the DomainNameServers' do
      expect(subject['DomainNameServers']).to match_array(['10.0.0.1', '10.0.0.2'])
    end

    it 'sets the NetbiosNameServers' do
      expect(subject['NetbiosNameServers']).to match_array(['10.0.0.1', '10.0.0.2'])
    end

    it 'sets the NetbiosNodeType' do
      expect(subject['NetbiosNodeType']).to eq(1)
    end

    it 'sets the NtpServers' do
      expect(subject['NtpServers']).to match_array(['10.0.0.1', '10.0.0.2'])
    end

    it 'sets tags' do
      expect(subject['Tags']).to include(hash_including('Key' => 'Name', 'Value' => 'Test'))
    end

    private

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

Version data entries

67 entries across 67 versions & 1 rubygems

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