diff --git a/tests.sh b/tests.sh
index fce6dc9113217902b4d93e15c5d0a304d0ca30ab..859679121b9956c0c18d341a8a269f6a06eaa3ad 100755
--- a/tests.sh
+++ b/tests.sh
@@ -9,9 +9,10 @@ export name='John'
 test "$(echo 'Hello {{ name if name is defined else 'world' }}.' | template)" = "Hello John."
 
 echo Testing arguments and reading/ writing to file.
-echo '{{ USER }}' > "$infile"
+echo '{{ name }}' > "$infile"
+export name='John'
 template --output "$outfile" "$infile"
-test "$(cat $outfile)" = "$USER"
+test "$(cat $outfile)" = "$name"
 
 echo Testing JSON parsing.
 export json='{"a": 1, "b": 2}'