test: fix a variable name
test: use temporary directory for testing