Description: move YARD global configuration directory to tmp/ during specs
 The specs try to write in this directory. The default location is in $HOME
 which is undefined and causes build failures with sbuild.
Forwarded: no
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=738409
Author: Cédric Boutillier <boutil@debian.org>
Last-Update: 2014-02-13

--- a/spec/config_spec.rb
+++ b/spec/config_spec.rb
@@ -1,8 +1,21 @@
 require File.join(File.dirname(__FILE__), "spec_helper")
 
 require 'yaml'
+require 'tmpdir'
 
 describe YARD::Config do
+  before :all do
+    YARD::Config::CONFIG_DIR=Dir.mktmpdir
+    YARD::Config::CONFIG_FILE=File.join(CONFIG_DIR, 'config')
+  end
+
+  after :all do
+    Dir.rmdir(YARD::Config::CONFIG_DIR)
+    YARD::Config::CONFIG_DIR=File.expand_path('~/.yard')
+    YARD::Config::CONFIG_FILE=File.join(CONFIG_DIR, 'config')
+  end
+
+
   describe '.load' do
     before do
       File.should_receive(:file?).twice.with(CLI::Yardoc::DEFAULT_YARDOPTS_FILE).and_return(false)
@@ -173,4 +186,4 @@
       YARD::Config.load_plugins.should == false
     end
   end
-end
\ No newline at end of file
+end
