From: Felix Geyer <debfx-pkg@fobos.de>
Bug-Debian: http://bugs.debian.org/664973
Forwarded: https://github.com/seattlerb/parsetree/pull/2
Last-Update: 2012-03-21
Description: Fix to the tests to build with no set home directory
 Ruby's Inline module builds in ~/.ruby_inline by default, but it's
 not defined when building with sbuild.

Index: ruby-parsetree/test/test_parse_tree.rb
===================================================================
--- ruby-parsetree.orig/test/test_parse_tree.rb	2011-11-24 17:06:52.000000000 -0600
+++ ruby-parsetree/test/test_parse_tree.rb	2012-03-21 18:09:02.000000000 -0600
@@ -1,12 +1,18 @@
 #!/usr/local/bin/ruby -w
 
-dir = File.expand_path "~/.ruby_inline"
-if test ?d, dir then
-  require 'fileutils'
-  puts "nuking #{dir}"
-  # force removal, Windoze is bitching at me, something to hunt later...
-  FileUtils.rm_r dir, :force => true
-end
+# instead of using Inline's regular directory in the user's home, use
+# a temporary directory
+
+#dir = File.expand_path "~/.ruby_inline"
+#if test ?d, dir then
+#  require 'fileutils'
+#  puts "nuking #{dir}"
+#  # force removal, Windoze is bitching at me, something to hunt later...
+#  FileUtils.rm_r dir, :force => true
+#end
+
+require 'tmpdir'
+ENV['INLINEDIR'] = Dir.mktmpdir
 
 require 'minitest/autorun'
 require 'parse_tree'
