Author: Gunnar Wolf <gwolf@debian.org>
Last-Update: 2012-01-23
Forwarded: Not-needed
Description: Fix the provided path for te tests
 lib/mechanize/test_case.rb assumes the tests are run inside a
 Gems-installed system, and fails to find the tests' data. Fix it by
 setting the right path for our build environment.

Index: ruby-mechanize/lib/mechanize/test_case.rb
===================================================================
--- ruby-mechanize.orig/lib/mechanize/test_case.rb	2013-05-06 15:57:41.884090539 +0200
+++ ruby-mechanize/lib/mechanize/test_case.rb	2013-05-06 15:57:41.876090614 +0200
@@ -34,7 +34,9 @@
 
 class Mechanize::TestCase < MiniTest::Unit::TestCase
 
-  TEST_DIR = File.expand_path '../../../test', __FILE__
+  # Test directory changed to what matches the Debian build process
+  # TEST_DIR = File.expand_path '../../../test', __FILE__
+  TEST_DIR = File.expand_path (Dir.pwd + '/test')
   REQUESTS = []
 
   ##
Index: ruby-mechanize/lib/mechanize/test_case/gzip_servlet.rb
===================================================================
--- ruby-mechanize.orig/lib/mechanize/test_case/gzip_servlet.rb	2013-05-06 15:57:41.884090539 +0200
+++ ruby-mechanize/lib/mechanize/test_case/gzip_servlet.rb	2013-05-06 15:57:41.876090614 +0200
@@ -3,7 +3,9 @@
 
 class GzipServlet < WEBrick::HTTPServlet::AbstractServlet
 
-  TEST_DIR = File.expand_path '../../../../test', __FILE__
+  # Test directory changed to what matches the Debian build process
+  # TEST_DIR = File.expand_path '../../../../test', __FILE__
+  TEST_DIR = File.expand_path (Dir.pwd + '/test')
 
   def do_GET(req, res)
     if req['Accept-Encoding'] !~ /gzip/ then
