def in_temp_dir
    tmpdir = Dir.mktmpdir
    tmpdir_realpath = File.realpath(tmpdir)
    Dir.chdir(tmpdir_realpath) do
      yield tmpdir_realpath
    end
  ensure
    FileUtils.rm_rf(tmpdir_realpath) if tmpdir_realpath
    # raise "Temp dir #{tmpdir} not removed. Remaining files : #{Dir["#{tmpdir}/**/*"]}" if File.exist?(tmpdir)
  end
Creates a temp directory and yields that path to the passed block

On Windows, using Dir.mktmpdir with a block sometimes raises an error:
`Errno::ENOTEMPTY: Directory not empty @ dir_s_rmdir`. I think this might
be a configuration issue with the Windows CI environment.

This was worked around by using the non-block form of Dir.mktmpdir and
then removing the directory manually in an ensure block.