File: set_path_for_test

package info (click to toggle)
ruby-mechanize 2.8.5-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,408 kB
  • sloc: ruby: 11,544; makefile: 7; sh: 4
file content (34 lines) | stat: -rw-r--r-- 1,195 bytes parent folder | download | duplicates (3)
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
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.

--- a/lib/mechanize/test_case.rb
+++ b/lib/mechanize/test_case.rb
@@ -40,7 +40,9 @@
 
 class Mechanize::TestCase < Minitest::Test
 
-  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 = []
 
   ##
--- a/lib/mechanize/test_case/gzip_servlet.rb
+++ b/lib/mechanize/test_case/gzip_servlet.rb
@@ -4,7 +4,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