diff --git a/t/includes/one.json b/t/includes/one.json new file mode 100644 index 0000000..955c956 --- /dev/null +++ b/t/includes/one.json @@ -0,0 +1,3 @@ +{ + "Fn::Include": "./$FILE_NAME.json" +} diff --git a/t/includes/two.json b/t/includes/two.json new file mode 100644 index 0000000..c8c4105 --- /dev/null +++ b/t/includes/two.json @@ -0,0 +1,3 @@ +{ + "foo": "bar" +} diff --git a/t/tests/cli.json b/t/tests/cli.json index 43f5040..a076aa6 100644 --- a/t/tests/cli.json +++ b/t/tests/cli.json @@ -116,6 +116,17 @@ "exitCode": 1, "errorMessage": "missed comma" }, + { + "name": "dynamic filename via env var", + "template": "t/includes/one.json", + "args": ["--enable", "eval,env"], + "env": { + "FILE_NAME": "two" + }, + "output": { + "foo": "bar" + } + }, { "name": "ifEval", "env": { diff --git a/t/tests/location.json b/t/tests/location.json index 40abeea..3b6cf47 100644 --- a/t/tests/location.json +++ b/t/tests/location.json @@ -129,6 +129,17 @@ "Mappings": null } }, + { + "name": "dynamic filename via env var ($FILE_NAME)", + "doEnv": true, + "inject": { "FILE_NAME": "two" }, + "template": { + "Fn::Include": "includes/one.json" + }, + "output": { + "foo": "bar" + } + }, { "name": "deep nested w/ query dev", "doEnv": true,