spec/output_spec.rb in cloudster-2.18.0 vs spec/output_spec.rb in cloudster-2.19.0
- old
+ new
@@ -1,8 +1,11 @@
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 => {
@@ -14,14 +17,28 @@
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']} ] ]}
+ {"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