-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: dmitriy kalinin <[email protected]>
- Loading branch information
1 parent
0a80a1d
commit acb0f0e
Showing
2 changed files
with
41 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -166,6 +166,18 @@ dup-key: ((key3)) | |
Expect(result).To(Equal([]byte("uri: nats://nats:[email protected]:4222\n"))) | ||
}) | ||
|
||
It("can interpolate multiple secret keys in the middle of a string even if keys have ! marks", func() { | ||
template := NewTemplate([]byte("uri: nats://nats:((!password))@((ip)):4222")) | ||
vars := Variables{ | ||
"password": "secret", | ||
"ip": "10.0.0.0", | ||
} | ||
|
||
result, err := template.Evaluate(vars, patch.Ops{}, EvaluateOpts{}) | ||
Expect(err).NotTo(HaveOccurred()) | ||
Expect(result).To(Equal([]byte("uri: nats://nats:[email protected]:4222\n"))) | ||
}) | ||
|
||
It("can interpolate multiple keys of type string and int in the middle of a string", func() { | ||
template := NewTemplate([]byte("address: ((ip)):((port))")) | ||
vars := Variables{ | ||
|