Fix tests on macOS
Created by: athei
One of the tests fails to pass on macOS. The reason is that the temporary pass used is a symlink and one side of the equality used path canonicalization while the other does not.
This PR fixes that by adding canonicalization to the test only with_tmp_dir
function.