File: 0014-no-relative-path-to-mentos-py.patch

package info (click to toggle)
ruby-pygments.rb 2.4.1%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 268 kB
  • sloc: ruby: 530; python: 139; makefile: 10; sh: 4
file content (30 lines) | stat: -rw-r--r-- 1,110 bytes parent folder | download
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
From: Debian Ruby Team <pkg-ruby-extras-maintainers@lists.alioth.debian.org>
Date: Thu, 30 Nov 2023 00:19:54 +0100
Subject: Do not use relative path to mentos.py

This fails when testing against the installed package.
Author: Alexandre Ghiti <alexandre.ghiti@canonical.com>
Last-Update: 2022-01-24
---
 test/test_pygments.rb | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/test/test_pygments.rb b/test/test_pygments.rb
index ff0cd80..a3a7673 100644
--- a/test/test_pygments.rb
+++ b/test/test_pygments.rb
@@ -10,8 +10,13 @@ PE = Pygments.engine
 class PygmentsHighlightTest < Test::Unit::TestCase
   RUBY_CODE = "#!/usr/bin/ruby\nputs 'foo'"
   RUBY_CODE_TRAILING_NEWLINE = "#!/usr/bin/ruby\nputs 'foo'\n"
+  begin
+    ruby_pygments_dir = Gem::Specification.find_by_name("pygments.rb").gem_dir
+  rescue Gem::MissingSpecError
+    ruby_pygments_dir = File.join(__dir__, '..')
+  end
   TEST_CODE = File.read(
-    File.join(__dir__, '..', 'lib', 'pygments', 'mentos.py')
+    File.join(ruby_pygments_dir, 'lib', 'pygments', 'mentos.py')
   )
 
   def test_highlight_defaults_to_html