aboutsummaryrefslogtreecommitdiffstats
path: root/test/rlx_release_SUITE.erl
diff options
context:
space:
mode:
authorTristan Sloughter <[email protected]>2019-08-13 09:25:26 -0600
committerGitHub <[email protected]>2019-08-13 09:25:26 -0600
commitdef78e1c07c2ae79b8ba5293365a466e79a88b15 (patch)
tree2f3fbf7a07136767fddd8342e01eb0fddc777620 /test/rlx_release_SUITE.erl
parent912f513028dee5b0e0900a8d5e3430669fccaf4c (diff)
parente644d7c078c9b75edf1ba513a030d33921af8192 (diff)
downloadrelx-def78e1c07c2ae79b8ba5293365a466e79a88b15.tar.gz
relx-def78e1c07c2ae79b8ba5293365a466e79a88b15.tar.bz2
relx-def78e1c07c2ae79b8ba5293365a466e79a88b15.zip
Merge pull request #747 from arcusfelis/template-redefined-variable
Correctly render redefined variable
Diffstat (limited to 'test/rlx_release_SUITE.erl')
-rw-r--r--test/rlx_release_SUITE.erl12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/rlx_release_SUITE.erl b/test/rlx_release_SUITE.erl
index 752ce18..d7340de 100644
--- a/test/rlx_release_SUITE.erl
+++ b/test/rlx_release_SUITE.erl
@@ -818,14 +818,18 @@ overlay_release(Config) ->
goal_app_2]}]),
VarsFile1 = filename:join([LibDir1, "vars1.config"]),
+ %% tpl_var is defined in vars1, but redifined in vars2 using template.
rlx_test_utils:write_config(VarsFile1, [{yahoo, "yahoo"},
{yahoo2, [{foo, "bar"}]},
{foo_yahoo, "foo_{{yahoo}}"},
- {foo_dir, "foodir"}]),
+ {foo_dir, "foodir"},
+ {tpl_var, "defined in vars1"}]),
VarsFile2 = filename:join([LibDir1, "vars2.config"]),
rlx_test_utils:write_config(VarsFile2, [{google, "yahoo"},
{yahoo2, "foo"},
+ {tpl_arg, "a template value"},
+ {tpl_var, "Redefined in vars2 with {{tpl_arg}}"},
OverlayVars3]),
VarsFile3 = filename:join([LibDir1, "vars3.config"]),
@@ -894,7 +898,11 @@ overlay_release(Config) ->
?assertEqual("val1",
proplists:get_value(prop1, TemplateData)),
?assertEqual(2,
- proplists:get_value(prop2, TemplateData)).
+ proplists:get_value(prop2, TemplateData)),
+ %% This should be rendered correctly based on VarsFile2 file, regardless
+ %% of tpl_var defined in VarsFile1 or not.
+ ?assertEqual("Redefined in vars2 with a template value",
+ proplists:get_value(tpl_var, TemplateData)).
make_goalless_release(Config) ->
LibDir1 = proplists:get_value(lib1, Config),