diff options
author | Bundlerbot <bot@bundler.io> | 2019-06-24 10:33:28 +0000 |
---|---|---|
committer | Bundlerbot <bot@bundler.io> | 2019-06-24 10:33:28 +0000 |
commit | c5dcdfbc3617d1ecf551f047456d4ea03a18f930 (patch) | |
tree | 0d2220557c369a371964385daf3442000ffc4f95 /spec/install/gems/compact_index_spec.rb | |
parent | 67bd477a2831e476c682ad41878ee99248420c07 (diff) | |
parent | b35d7fc74ace61e86ebdc4f82a8beb0d8baabf07 (diff) | |
download | bundler-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/install/gems/compact_index_spec.rb')
-rw-r--r-- | spec/install/gems/compact_index_spec.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/install/gems/compact_index_spec.rb b/spec/install/gems/compact_index_spec.rb index e35b630306..2c145ce643 100644 --- a/spec/install/gems/compact_index_spec.rb +++ b/spec/install/gems/compact_index_spec.rb @@ -93,7 +93,7 @@ RSpec.describe "compact index api" do gemfile <<-G source "#{source_uri}" - git "file:///#{lib_path("foo-1.0")}" do + git "#{file_uri_for(lib_path("foo-1.0"))}" do gem 'foo' end G @@ -111,7 +111,7 @@ RSpec.describe "compact index api" do gemfile <<-G source "#{source_uri}" - gem 'foo', :git => "file:///#{lib_path("foo-1.0")}" + gem 'foo', :git => "#{file_uri_for(lib_path("foo-1.0"))}" G bundle! :install, :artifice => "compact_index" @@ -125,7 +125,7 @@ RSpec.describe "compact index api" do build_git "foo" gemfile <<-G source "#{source_uri}" - gem 'foo', :git => "file:///#{lib_path("foo-1.0")}" + gem 'foo', :git => "#{file_uri_for(lib_path("foo-1.0"))}" G bundle "install", :artifice => "compact_index" @@ -623,7 +623,7 @@ The checksum of /versions does not match the checksum provided by the server! So it "strips http basic auth creds when warning about ambiguous sources", :bundler => "< 3" do gemfile <<-G source "#{basic_auth_source_uri}" - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack" G |