Skip to content

Commit

Permalink
Add test for YAML alias support
Browse files Browse the repository at this point in the history
  • Loading branch information
DazWorrall committed Jul 9, 2019
1 parent 2f353b4 commit 08ced4f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/fixtures/for_unit_tests/bindings-with-aliases.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
alias: &alias
baz: bang
foo: a,b,c
bar:
<<: *alias
7 changes: 7 additions & 0 deletions test/unit/kubernetes-deploy/bindings_parser_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ def test_parse_nested_values
assert_equal(expected, bindings.parse)
end

def test_parses_yaml_file_with_aliases
expected = { "foo" => "a,b,c", "bar" => { "baz" => "bang" }, "alias" => { "baz" => "bang" } }
bindings = KubernetesDeploy::BindingsParser.new
bindings.add('@test/fixtures/for_unit_tests/bindings-with-aliases.yaml')
assert_equal(expected, bindings.parse)
end

private

def parse(string)
Expand Down

0 comments on commit 08ced4f

Please sign in to comment.