File: fix-rake-task.patch

package info (click to toggle)
ruby-rspec 3.5.0c3e0m0s0-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 6,312 kB
  • ctags: 4,788
  • sloc: ruby: 62,572; sh: 785; makefile: 100
file content (84 lines) | stat: -rw-r--r-- 2,968 bytes parent folder | download | duplicates (2)
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
Description: Fix patch to rspec binary
 On Debian rspec is always on /usr/bin
Author: Antonio Terceiro <terceiro@debian.org>
Origin: vendor
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=782161
Last-Update: 2016-03-02
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/rspec-core/lib/rspec/core/rake_task.rb
+++ b/rspec-core/lib/rspec/core/rake_task.rb
@@ -22,7 +22,7 @@ module RSpec
       include RSpec::Core::ShellEscape
 
       # Default path to the RSpec executable.
-      DEFAULT_RSPEC_PATH = File.expand_path('../../../../exe/rspec', __FILE__)
+      DEFAULT_RSPEC_PATH = '/usr/bin/rspec'
 
       # Default pattern for spec files.
       DEFAULT_PATTERN = 'spec/**{,/*/**}/*_spec.rb'
@@ -142,7 +142,6 @@ module RSpec
         cmd_parts = []
         cmd_parts << RUBY
         cmd_parts << ruby_opts
-        cmd_parts << rspec_load_path
         cmd_parts << escape(rspec_path)
         cmd_parts << file_inclusion_specification
         cmd_parts << file_exclusion_specification
@@ -154,15 +153,6 @@ module RSpec
         lambda { |s| s.nil? || s == "" }
       end
 
-      def rspec_load_path
-        @rspec_load_path ||= begin
-          core_and_support = $LOAD_PATH.grep(
-            /#{File::SEPARATOR}rspec-(core|support)[^#{File::SEPARATOR}]*#{File::SEPARATOR}lib/
-          ).uniq
-
-          "-I#{core_and_support.map { |file| escape file }.join(File::PATH_SEPARATOR)}"
-        end
-      end
     end
   end
 end
--- a/rspec-core/spec/rspec/core/rake_task_spec.rb
+++ b/rspec-core/spec/rspec/core/rake_task_spec.rb
@@ -32,18 +32,16 @@ module RSpec::Core
       end
     end
 
-    default_load_path_opts = '-I\S+'
-
     context "default" do
       it "renders rspec" do
-        expect(spec_command).to match(/^#{ruby} #{default_load_path_opts} '?#{task.rspec_path}'?/)
+        expect(spec_command).to match(/^#{ruby} '?#{task.rspec_path}'?/)
       end
     end
 
     context "with space", :unless => RSpec::Support::OS.windows? do
       it "renders rspec with space escaped" do
         task.rspec_path = '/path with space/exe/rspec'
-        expect(spec_command).to match(/^#{ruby} #{default_load_path_opts} \/path\\ with\\ space\/exe\/rspec/)
+        expect(spec_command).to match(/^#{ruby} \/path\\ with\\ space\/exe\/rspec/)
       end
     end
 
@@ -57,7 +55,7 @@ module RSpec::Core
     context "with ruby options" do
       it "renders them before the rspec path" do
         task.ruby_opts = "-w"
-        expect(spec_command).to match(/^#{ruby} -w #{default_load_path_opts} '?#{task.rspec_path}'?/)
+        expect(spec_command).to match(/^#{ruby} -w '?#{task.rspec_path}'?/)
       end
     end
 
@@ -249,7 +247,7 @@ module RSpec::Core
 
         expect(spec_command).not_to include_extra_load_path_entries
       end
-    end
+    end if false
 
     it "sets the files to run in a consistent order, regardless of the underlying FileList ordering" do
       task.pattern = 'a/*.rb'