Skip to content

Commit

Permalink
More tests for !Split
Browse files Browse the repository at this point in the history
  • Loading branch information
drrb committed Mar 30, 2017
1 parent 07f9707 commit 132b1f1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
16 changes: 16 additions & 0 deletions features/yamly_shortcuts.feature
Expand Up @@ -60,6 +60,22 @@ Feature: YAMLy shortcuts
}
"""

Scenario: Split function call
Given I have a file "split.yml" containing
"""
Split: !Split
- "|"
- "a|b|c"
"""
When I process "split.yml"
Then the output should match JSON
"""
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Split" : { "Fn::Split" : [ "|", "a|b|c" ] }
}
"""

Scenario: Join function call with empty strings
Given I have a file "join.yml" containing
"""
Expand Down
5 changes: 5 additions & 0 deletions spec/cfoo/parser_spec.rb
Expand Up @@ -108,6 +108,11 @@ module Cfoo

parser.parse_file("join.yml").should == {"Fn::Join" => [ "" , [ "a", "b", "c" ] ] }
end
it "wraps splits in AWS Split function-calls" do
file_system.should_receive(:parse_file).with("split.yml").and_return(YAML::DomainType.create("Split", ["|", "a|b|c"]))

parser.parse_file("split.yml").should == {"Fn::Split" => [ "|" , "a|b|c" ] }
end
it "wraps map lookups in AWS FindInMap function-calls" do
file_system.should_receive(:parse_file).with("findinmap.yml").and_return(YAML::DomainType.create("FindInMap", ["Map", "Key", "Value"]))

Expand Down

0 comments on commit 132b1f1

Please sign in to comment.