summaryrefslogtreecommitdiff
path: root/spec/bundler/plugin/installer_spec.rb
diff options
context:
space:
mode:
authorBundlerbot <bot@bundler.io>2019-06-24 10:33:28 +0000
committerBundlerbot <bot@bundler.io>2019-06-24 10:33:28 +0000
commitc5dcdfbc3617d1ecf551f047456d4ea03a18f930 (patch)
tree0d2220557c369a371964385daf3442000ffc4f95 /spec/bundler/plugin/installer_spec.rb
parent67bd477a2831e476c682ad41878ee99248420c07 (diff)
parentb35d7fc74ace61e86ebdc4f82a8beb0d8baabf07 (diff)
downloadbundler-c5dcdfbc3617d1ecf551f047456d4ea03a18f930.tar.gz
Merge #7161
7161: Fix file URIs on Windows r=hsbt a=deivid-rodriguez ### What was the end-user problem that led to this PR? The problem was that file:// URIs were not properly handled on Windows, and those are heavily used by our specs. ### What was your diagnosis of the problem? My diagnosis was that Windows paths do not start with a slash, so we need to add an extra slash to separate the host from the path in file:// urls. Otherwise "D:" is parsed as the host segment in the URI. As a consequence of that change, we also need to strip that leading character when using the path segment for those URIs, so that it's a valid file path on Windows. This change reduces Windows CI spec failures from 429 to 355. In order to apply this fix for all file URI's in tests, I extracted a helper method and searched and replaced all file:// ocurrences with the method. The diff is big because of that, but I think it works fine. Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
Diffstat (limited to 'spec/bundler/plugin/installer_spec.rb')
-rw-r--r--spec/bundler/plugin/installer_spec.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/bundler/plugin/installer_spec.rb b/spec/bundler/plugin/installer_spec.rb
index 71fef76042..65f6b4ab6b 100644
--- a/spec/bundler/plugin/installer_spec.rb
+++ b/spec/bundler/plugin/installer_spec.rb
@@ -58,7 +58,7 @@ RSpec.describe Bundler::Plugin::Installer do
end
let(:result) do
- installer.install(["ga-plugin"], :git => "file://#{lib_path("ga-plugin")}")
+ installer.install(["ga-plugin"], :git => "#{file_uri_for(lib_path("ga-plugin"))}")
end
it "returns the installed spec after installing" do
@@ -98,7 +98,7 @@ RSpec.describe Bundler::Plugin::Installer do
context "rubygems plugins" do
let(:result) do
- installer.install(["re-plugin"], :source => "file://#{gem_repo2}")
+ installer.install(["re-plugin"], :source => "#{file_uri_for(gem_repo2)}")
end
it "returns the installed spec after installing " do
@@ -113,7 +113,7 @@ RSpec.describe Bundler::Plugin::Installer do
context "multiple plugins" do
let(:result) do
- installer.install(["re-plugin", "ma-plugin"], :source => "file://#{gem_repo2}")
+ installer.install(["re-plugin", "ma-plugin"], :source => "#{file_uri_for(gem_repo2)}")
end
it "returns the installed spec after installing " do