summaryrefslogtreecommitdiff
path: root/tests/integration
diff options
context:
space:
mode:
authorDave Henderson <dhenderson@gmail.com>2020-04-22 21:30:51 -0400
committerDave Henderson <dhenderson@gmail.com>2020-04-22 21:44:09 -0400
commit55bea115b1b3891bf9f490dfebec79aaa29ccfa4 (patch)
tree584bfe490832ba34c6ca758ceb493ef56315e374 /tests/integration
parent46ceeee0b95fd12455020fe85bdd03cb5ccdf87c (diff)
Fix bug in file URL parsing
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'tests/integration')
-rw-r--r--tests/integration/datasources_file_test.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/integration/datasources_file_test.go b/tests/integration/datasources_file_test.go
index 6966393e..8304bca7 100644
--- a/tests/integration/datasources_file_test.go
+++ b/tests/integration/datasources_file_test.go
@@ -19,6 +19,7 @@ func (s *FileDatasourcesSuite) SetUpSuite(c *C) {
s.tmpDir = fs.NewDir(c, "gomplate-inttests",
fs.WithFiles(map[string]string{
"config.json": `{"foo": {"bar": "baz"}}`,
+ "ajsonfile": `{"foo": {"bar": "baz"}}`,
"encrypted.json": `{
"_public_key": "dfcf98785869cdfc4a59273bbdfe1bfcf6c44850a11ea9d84db21c89a802c057",
"password": "EJ[1:Cb1AY94Dl76xwHHrnJyh+Y+fAeovijPlFQZXSAuvZBc=:oCGZM6lbeXXOl2ONSKfLQ0AgaltrTpNU:VjegqQPPkOK1hSylMAbmcfusQImfkHCWZw==]"
@@ -100,6 +101,11 @@ func (s *FileDatasourcesSuite) TestFileDatasources(c *C) {
result.Assert(c, icmd.Expected{ExitCode: 0, Out: "foobarbaz"})
result = icmd.RunCommand(GomplateBin,
+ "-i", `foo{{defineDatasource "config" `+"`"+s.tmpDir.Join("ajsonfile")+"?type=application/json`"+`}}bar{{(datasource "config").foo.bar}}`,
+ )
+ result.Assert(c, icmd.Expected{ExitCode: 0, Out: "foobarbaz"})
+
+ result = icmd.RunCommand(GomplateBin,
"-d", "config="+s.tmpDir.Join("config.yml"),
"-i", `{{(datasource "config").foo.bar}}`,
)