Package: ruby-clockwork / 2.0.3-4

0002-Do-not-use-relative-require-in-tests.patch Patch series | 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
Description: Do not use relative require in tests
 Fixes autopkgtests.
Author: Lucas Kanashiro <kanashiro@debian.org>
Last-Updated: 2019-02-12

--- a/test/at_test.rb
+++ b/test/at_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path('../../lib/clockwork', __FILE__)
+require 'clockwork'
 require "minitest/autorun"
 require 'mocha/setup'
 require 'time'
--- a/test/clockwork_test.rb
+++ b/test/clockwork_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path('../../lib/clockwork', __FILE__)
+require 'clockwork'
 require 'minitest/autorun'
 require 'mocha/setup'
 
--- a/test/event_test.rb
+++ b/test/event_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path('../../lib/clockwork', __FILE__)
+require 'clockwork'
 require "minitest/autorun"
 
 describe Clockwork::Event do
--- a/test/manager_test.rb
+++ b/test/manager_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path('../../lib/clockwork', __FILE__)
+require 'clockwork'
 require "minitest/autorun"
 require 'mocha/setup'
 require 'time'
--- a/test/signal_test.rb
+++ b/test/signal_test.rb
@@ -7,6 +7,11 @@ class SignalTest < Test::Unit::TestCase
   SAMPLE  = File.expand_path('../samples/signal_test.rb', __FILE__)
   LOGFILE = File.expand_path('../tmp/signal_test.log', __FILE__)
 
+  if ENV['ADTTMP']
+    CMD     = '/usr/bin/clockwork'
+    LOGFILE = "/#{ENV['ADTTMP']}/signal_test.log"
+  end
+
   setup do
     FileUtils.mkdir_p(File.dirname(LOGFILE))
     @pid = spawn(CMD, SAMPLE)
--- a/test/database_events/synchronizer_test.rb
+++ b/test/database_events/synchronizer_test.rb
@@ -3,8 +3,7 @@ require 'mocha/setup'
 require 'time'
 require 'active_support/time'
 
-require_relative '../../lib/clockwork'
-require_relative '../../lib/clockwork/database_events'
+require 'clockwork'
 require_relative 'test_helpers'
 
 describe Clockwork::DatabaseEvents::Synchronizer do