File: inline_path_in_tmp

package info (click to toggle)
ruby-image-science 1.2.2-1.2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 164 kB
  • ctags: 31
  • sloc: ruby: 404; makefile: 8
file content (36 lines) | stat: -rw-r--r-- 1,394 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Author: Gunnar Wolf <gwolf@debian.org
Last-update: 2012-03-15
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=652802
Forwarded: http://rubyforge.org/tracker/index.php?func=detail&aid=29544&group_id=1513&atid=5921
Description: Use a temporary directory instead of ~ for the tests
 The tests wipe ~/.ruby_inline (and later use it). This causes sbuild
 to fail, as the home directory does not exist.

Index: ruby-image-science/test/test_image_science.rb
===================================================================
--- ruby-image-science.orig/test/test_image_science.rb	2011-09-14 16:53:31.000000000 -0500
+++ ruby-image-science/test/test_image_science.rb	2012-03-15 13:13:31.000000000 -0600
@@ -1,10 +1,16 @@
-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 'rubygems'
 require 'minitest/unit'