File: use-installed-lib.diff

package info (click to toggle)
sugarjar 0.0.11-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 392 kB
  • sloc: ruby: 1,266; sh: 75; makefile: 4
file content (26 lines) | stat: -rw-r--r-- 1,181 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
Description: Allow commands_spec to be run against the installed copy of sugarjar
 For Ruby packages, Debian autopkgtest runs in an environment where
 `gem2deb-test-runner` removes the `lib` directory from the source tree, so
 the specs have to be able to load the installed copy instead.
 .
 With this change, `lib` gets added to the front of the path, and the relative
 `require` is changed to not specify a path. So when specs are run from a
 source tree checkout the `lib` in the checkout is still preferred, but if it's
 not available the installed library gets used to satisfy the `require`.
 .
 See https://wiki.debian.org/Teams/Ruby/Packaging/Tests#Case_eight:_autopkgtest_failure
Author: Michel Alexandre Salim <michel@michel-slm.name>
Bug: https://github.com/jaymzh/sugarjar/pull/126
Last-Update: 2022-10-19
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/spec/commands_spec.rb
+++ b/spec/commands_spec.rb
@@ -1,5 +1,6 @@
 # require 'spec_helper'
-require_relative '../lib/sugarjar/commands'
+$:.unshift File.expand_path('../lib', __FILE__)
+require 'sugarjar/commands'
 
 describe 'SugarJar::Commands' do
   context '#set_commit_template' do