Sha256: 5a6e57c0552b9ab70e201d26d463d8e97ce1c28de39cca5912cff0bc1ba2720d

Contents?: true

Size: 1.14 KB

Versions: 49

Compression:

Stored size: 1.14 KB

Contents

describe 'Kumogata::Client#export' do
  it 'export a template' do
    json = <<-EOS
{
  "Resources": {
    "myEC2Instance": {
      "Type": "AWS::EC2::Instance",
      "Properties": {
        "ImageId": "ami-XXXXXXXX",
        "InstanceType": "t1.micro"
      }
    }
  },
  "Outputs": {
    "AZ": {
      "Value": {
        "Fn::GetAtt": [
          "myEC2Instance",
          "AvailabilityZone"
        ]
      }
    }
  }
}
    EOS

    template = run_client(:export, :arguments => ['MyStack']) do |client, cf|
      stack = make_double('stack') do |obj|
        obj.should_receive(:status) { 'CREATE_COMPLETE' }
        obj.should_receive(:template) { json }
      end

      stacks = make_double('stacks') do |obj|
        obj.should_receive(:[]).with('MyStack') { stack }
      end

      cf.should_receive(:stacks) { stacks }
    end

    expect(template).to eq((<<-EOS).chomp)
Resources do
  myEC2Instance do
    Type "AWS::EC2::Instance"
    Properties do
      ImageId "ami-XXXXXXXX"
      InstanceType "t1.micro"
    end
  end
end
Outputs do
  AZ do
    Value do
      Fn__GetAtt "myEC2Instance", "AvailabilityZone"
    end
  end
end
    EOS
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
kumogata-0.4.6 spec/kumogata_export_spec.rb
kumogata-0.4.5 spec/kumogata_export_spec.rb
kumogata-0.4.4 spec/kumogata_export_spec.rb
kumogata-0.4.3 spec/kumogata_export_spec.rb
kumogata-0.4.2 spec/kumogata_export_spec.rb
kumogata-0.4.1 spec/kumogata_export_spec.rb
kumogata-0.4.0 spec/kumogata_export_spec.rb
kumogata-0.3.14 spec/kumogata_export_spec.rb
kumogata-0.3.13 spec/kumogata_export_spec.rb
kumogata-0.3.12 spec/kumogata_export_spec.rb
kumogata-0.3.11 spec/kumogata_export_spec.rb
kumogata-0.3.10 spec/kumogata_export_spec.rb
kumogata-0.3.9 spec/kumogata_export_spec.rb
kumogata-0.3.8 spec/kumogata_export_spec.rb
kumogata-0.3.7 spec/kumogata_export_spec.rb
kumogata-0.3.6 spec/kumogata_export_spec.rb
kumogata-0.3.5 spec/kumogata_export_spec.rb
kumogata-0.3.4 spec/kumogata_export_spec.rb
kumogata-0.3.3 spec/kumogata_export_spec.rb
kumogata-0.3.2 spec/kumogata_export_spec.rb