Sha256: 1351d40036f25cb56238ec4ea1f5ca7c35fe1aa4f6a8ebc5423db639069b4ba5

Contents?: true

Size: 1.36 KB

Versions: 1

Compression:

Stored size: 1.36 KB

Contents

require 'spec_helper'

describe Cloudster::ChefClient do
  describe 'initialize' do
    it "should raise argument error if no argument is not provided" do
      expect { Cloudster::CloudFront.new() }.to raise_error(ArgumentError, 'Missing required argument: name')
    end
    it "should not raise argument error if all arguments are provided" do
      expect { Cloudster::CloudFront.new(:name => 'CloudFront') }.to_not raise_error
    end
  end
  describe '#add_to' do
    it "should add elastic ip configuration to ec2 template" do
      bucket = bucket = Cloudster::S3.new(:name => 'S3ResourceName',:access_control => 'PublicRead')
      cloud_front = Cloudster::CloudFront.new(:name => 'CloudFront')
      cloud_front.add_to bucket
      bucket.template.should ==
        {
          "Resources"=>{
            "S3ResourceName"=>{
              "Type"=>"AWS::S3::Bucket",
              "Properties"=>{
                "AccessControl"=>"PublicRead"
              }
            },
            "CloudFront"=>{
              "Type"=>"AWS::CloudFront::Distribution",
              "Properties"=>{
                "DistributionConfig"=> {
                  "S3Origin" => {
                    "DNSName"=>{"Fn::GetAtt"=>["S3ResourceName", "DomainName"]}
                  },
                  "Enabled"=>"true"
                }
              }
            }
          }
        }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cloudster-2.17.0 spec/cloud_front_spec.rb