Skip to content

Commit aad871c

Browse files
Remove unnecessary loading of fileutils from path specs
These specs load artifice before Bundler boots because of their global rubygems source. Artifice in turn loads `rack`, `rack-test`, and `tmpdir` which in turn load `fileutils`. Because of this, a missing `require` of `fileutils` in RubyGems would not be caught by specs. Loading artifice is not necessary for most of these specs, so remove the global source to avoid it.
1 parent 2eaada3 commit aad871c

File tree

1 file changed

+0
-32
lines changed

1 file changed

+0
-32
lines changed

bundler/spec/install/gemfile/path_spec.rb

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
build_lib "foo"
1717

1818
install_gemfile <<-G
19-
source "https://gem.repo1"
2019
path "#{lib_path("foo-1.0")}" do
2120
gem 'foo'
2221
end
@@ -29,7 +28,6 @@
2928
build_lib "foo"
3029

3130
install_gemfile <<-G
32-
source "https://gem.repo1"
3331
gem 'foo', :path => "#{lib_path("foo-1.0")}"
3432
G
3533

@@ -42,7 +40,6 @@
4240
relative_path = lib_path("foo-1.0").relative_path_from(bundled_app)
4341

4442
install_gemfile <<-G
45-
source "https://gem.repo1"
4643
gem 'foo', :path => "#{relative_path}"
4744
G
4845

@@ -55,7 +52,6 @@
5552
relative_path = lib_path("foo-1.0").relative_path_from(Pathname.new("~").expand_path)
5653

5754
install_gemfile <<-G
58-
source "https://gem.repo1"
5955
gem 'foo', :path => "~/#{relative_path}"
6056
G
6157

@@ -70,7 +66,6 @@
7066
relative_path = lib_path("foo-1.0").relative_path_from(Pathname.new("/home/#{username}").expand_path)
7167

7268
install_gemfile <<-G, raise_on_error: false
73-
source "https://gem.repo1"
7469
gem 'foo', :path => "~#{username}/#{relative_path}"
7570
G
7671
expect(err).to match("There was an error while trying to use the path `~#{username}/#{relative_path}`.")
@@ -81,7 +76,6 @@
8176
build_lib "foo", path: bundled_app("foo-1.0")
8277

8378
install_gemfile <<-G
84-
source "https://gem.repo1"
8579
gem 'foo', :path => "./foo-1.0"
8680
G
8781

@@ -139,7 +133,6 @@
139133
build_lib "foo", path: bundled_app("foo-1.0")
140134

141135
install_gemfile <<-G
142-
source "https://gem.repo1"
143136
gem 'foo', :path => File.expand_path("foo-1.0", __dir__)
144137
G
145138

@@ -159,7 +152,6 @@
159152
end
160153

161154
install_gemfile <<-G
162-
source "https://gem.repo1"
163155
gem "foo", :path => "#{lib_path("nested")}"
164156
G
165157

@@ -179,7 +171,6 @@
179171
build_lib "foo", "1.0.0", path: lib_path("omg/foo")
180172

181173
install_gemfile <<-G
182-
source "https://gem.repo1"
183174
gem "omg", :path => "#{lib_path("omg")}"
184175
G
185176

@@ -256,7 +247,6 @@
256247
build_lib "omg", "2.0", path: lib_path("omg")
257248

258249
install_gemfile <<-G
259-
source "https://gem.repo1"
260250
gem "omg", :path => "#{lib_path("omg")}"
261251
G
262252

@@ -280,7 +270,6 @@
280270
end
281271

282272
install_gemfile <<-G
283-
source "https://gem.repo1"
284273
gem "premailer", :path => "#{lib_path("premailer")}"
285274
G
286275

@@ -302,7 +291,6 @@
302291
end
303292

304293
install_gemfile <<-G, raise_on_error: false
305-
source "https://gem.repo1"
306294
gem "foo", :path => "#{lib_path("foo-1.0")}"
307295
G
308296

@@ -439,7 +427,6 @@
439427
end
440428

441429
install_gemfile <<-G, raise_on_error: false
442-
source "https://gem.repo1"
443430
gemspec :path => "#{lib_path("foo")}"
444431
G
445432

@@ -453,7 +440,6 @@
453440
end
454441

455442
install_gemfile <<-G
456-
source "https://gem.repo1"
457443
gemspec :path => "#{lib_path("foo")}", :name => "foo"
458444
G
459445

@@ -466,7 +452,6 @@
466452
end
467453

468454
install_gemfile <<-G, verbose: true
469-
source "https://gem.repo1"
470455
path "#{lib_path("foo-1.0")}" do
471456
gem 'foo'
472457
end
@@ -484,7 +469,6 @@
484469
lib_path("foo-1.0").join("bin/performance").mkpath
485470

486471
install_gemfile <<-G
487-
source "https://gem.repo1"
488472
gem 'foo', '1.0', :path => "#{lib_path("foo-1.0")}"
489473
G
490474
expect(err).to be_empty
@@ -494,7 +478,6 @@
494478
build_lib "foo"
495479

496480
install_gemfile <<-G
497-
source "https://gem.repo1"
498481
gem 'foo', :path => "#{lib_path("foo-1.0")}"
499482
G
500483

@@ -507,7 +490,6 @@
507490
build_lib "hi2u"
508491

509492
install_gemfile <<-G
510-
source "https://gem.repo1"
511493
path "#{lib_path}" do
512494
gem "omg"
513495
gem "hi2u"
@@ -526,7 +508,6 @@
526508
end
527509

528510
install_gemfile <<-G
529-
source "https://gem.repo1"
530511
gem "foo", :path => "#{lib_path("foo")}"
531512
gem "omg", :path => "#{lib_path("omg")}"
532513
G
@@ -538,7 +519,6 @@
538519
build_lib "foo", gemspec: false
539520

540521
gemfile <<-G
541-
source "https://gem.repo1"
542522
gem "foo", "1.0", :path => "#{lib_path("foo-1.0")}"
543523
G
544524

@@ -552,15 +532,11 @@
552532
PATH
553533
remote: vendor/bar
554534
specs:
555-
556-
GEM
557-
remote: http://rubygems.org/
558535
L
559536

560537
FileUtils.mkdir_p(bundled_app("vendor/bar"))
561538

562539
install_gemfile <<-G
563-
source "http://rubygems.org"
564540
gem "bar", "1.0.0", path: "vendor/bar", require: "bar/nyard"
565541
G
566542
end
@@ -605,7 +581,6 @@
605581
end
606582

607583
install_gemfile <<-G
608-
source "https://gem.repo1"
609584
gem "foo", :path => "#{lib_path("foo-1.0")}"
610585
G
611586

@@ -621,7 +596,6 @@
621596
build_lib "bar", "1.0", path: lib_path("foo/bar")
622597

623598
install_gemfile <<-G
624-
source "https://gem.repo1"
625599
gem "foo", :path => "#{lib_path("foo")}"
626600
G
627601
end
@@ -868,12 +842,10 @@
868842
end
869843

870844
install_gemfile <<-G
871-
source "https://gem.repo1"
872845
gem "bar", :git => "#{lib_path("bar")}"
873846
G
874847

875848
install_gemfile <<-G
876-
source "https://gem.repo1"
877849
gem "bar", :path => "#{lib_path("bar")}"
878850
G
879851

@@ -928,7 +900,6 @@
928900
it "runs pre-install hooks" do
929901
build_git "foo"
930902
gemfile <<-G
931-
source "https://gem.repo1"
932903
gem "foo", :git => "#{lib_path("foo-1.0")}"
933904
G
934905

@@ -948,7 +919,6 @@
948919
it "runs post-install hooks" do
949920
build_git "foo"
950921
gemfile <<-G
951-
source "https://gem.repo1"
952922
gem "foo", :git => "#{lib_path("foo-1.0")}"
953923
G
954924

@@ -968,7 +938,6 @@
968938
it "complains if the install hook fails" do
969939
build_git "foo"
970940
gemfile <<-G
971-
source "https://gem.repo1"
972941
gem "foo", :git => "#{lib_path("foo-1.0")}"
973942
G
974943

@@ -999,7 +968,6 @@
999968
end
1000969

1001970
install_gemfile <<-G
1002-
source "https://gem.repo1"
1003971
gem "foo", :path => "#{lib_path("foo-1.0")}"
1004972
gem "bar", :path => "#{lib_path("bar-1.0")}"
1005973
G

0 commit comments

Comments
 (0)