Fix tests for CVE-2018-6914
Fix tests for CVE-2018-6914

Since the current working directory is not involved in `Tempfile`
and `Dir.mktmpdir` (except for the last resort), it is incorrect
to derive the traversal path from it.  Also, since the rubyspec
temporary directory is created under the build directory, this is
not involved in the target method.  Fixed sporadic errors in
test-spec.

nobu/rubyspec,ruby/spec,ruby/spec,eregon/rubyspec,eregon/rubyspec,nobu/rubyspec,nobu/rubyspec,eregon/rubyspec,ruby/spec