Skip to content

Commit ef8a91f

Browse files
committed
Added tests to verify env works.
Closes: #2
1 parent d1fe872 commit ef8a91f

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

examples/testing/testing.template

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ Functions
1616
Environment variables
1717
---------------------
1818

19-
- HOME: `{{env "HOME"}}`
20-
- USER: `{{env "USER"}}`
21-
- TERM: `{{env "TERM"}}`
22-
- PATH: `{{env "PATH"}}`
19+
- HOME: `{{env "HOME"}}`
20+
- USER: `{{env "USER"}}`
21+
- TERM: `{{env "TERM"}}`
22+
- PATH: `{{env "PATH"}}`
23+
- RUNNING_WITH: `{{env "RUNNING_WITH"}}`
24+
- TODAY_IS: `{{env "TODAY_IS"}}`
2325

2426
Data
2527
----

script/test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ for example in examples/*; do
2121
template=$(compgen -G "${example}"/*.template || :)
2222
json=$(compgen -G "${example}/*.json" || :)
2323
if [ -r "${json}" ]; then
24-
go run ./*.go --json-data "$json" "$template"
24+
env RUNNING_WITH=json TODAY_IS="$(date)" go run ./*.go --json-data "$json" "$template"
2525
else
26-
go run ./*.go "$template"
26+
env RUNNING_WITH=env TODAY_IS="$(date)" go run ./*.go "$template"
2727
fi
2828
done
2929

0 commit comments

Comments
 (0)