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
|