Sha256: a01abb39d1894bfea4da0d78096763afc4f7bf1b3f76feb621e623976fa791e6
Contents?: true
Size: 1.46 KB
Versions: 9
Compression:
Stored size: 1.46 KB
Contents
require 'spec_helper' describe Cloudster::Output do class Resource;end Resource.extend(Cloudster::Output) describe "output_template" do it "should return the cloudformation template for the Outputs" do resource_name = "S3ResourceName" outputs = { resource_name => { 'bucket_name' => {"Ref" => resource_name }, 'dns_name' => {'Fn::GetAtt' => [resource_name, 'DomainName']} } } class Resource;end Resource.extend(Cloudster::Output) Resource.output_template(outputs).should == { resource_name => { "Value" => { "Fn::Join" => [ ",",[ {"Fn::Join" => ["|", ['bucket_name', {"Ref" => resource_name } ] ]}, {"Fn::Join" => ["|", ['dns_name', {'Fn::GetAtt' => [resource_name, 'DomainName']} ] ]} ]] } } } end end describe "parse_outputs" do it "should return a hash of outputs" do outputs = "bucket_name|teststack3-testbucket1,dns_name|teststack3-testbucket1.s3.amazonaws.com,website_url|http://teststack3-testbucket1.s3-website-us-east-1.amazonaws.com" class Resource;end Resource.extend(Cloudster::Output) Resource.parse_outputs(outputs).should == { "bucket_name" => "teststack3-testbucket1", "dns_name" => "teststack3-testbucket1.s3.amazonaws.com", "website_url" => "http://teststack3-testbucket1.s3-website-us-east-1.amazonaws.com" } end end end
Version data entries
9 entries across 9 versions & 1 rubygems