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
Merge pull request #846 from gkarekinian/fix_18_tempfile

Fix tests failing on Ruby 1.8