Fix tests failing on Ruby 1.8

Tempfile doesn't automatically do string coercion when passed as an argument to File.
I've switched to using the `File#path` method explicitely.

Refs #845