summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-05-04 14:53:45 +0200
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-05-06 15:16:26 +0200
commitb06d4ba49f2d55439425cf402b2aa34ef7aef20e (patch)
treeca2bd5da482c5e842819470eb58ce8cb10574178
parent1409c72184a6bc17f0d8ededfa47517ccf9035b4 (diff)
downloadbundler-b06d4ba49f2d55439425cf402b2aa34ef7aef20e.tar.gz
Remove `normalize_uri_file` helper
-rw-r--r--spec/commands/install_spec.rb2
-rw-r--r--spec/commands/lock_spec.rb8
-rw-r--r--spec/commands/post_bundle_message_spec.rb2
-rw-r--r--spec/install/failure_spec.rb4
-rw-r--r--spec/install/gemfile/gemspec_spec.rb6
-rw-r--r--spec/install/gemfile/platform_spec.rb14
-rw-r--r--spec/install/gemfile/sources_spec.rb8
-rw-r--r--spec/install/gems/mirror_spec.rb6
-rw-r--r--spec/runtime/setup_spec.rb2
-rw-r--r--spec/support/helpers.rb6
-rw-r--r--spec/support/matchers.rb2
11 files changed, 28 insertions, 32 deletions
diff --git a/spec/commands/install_spec.rb b/spec/commands/install_spec.rb
index fd325b79fb..0468ce9672 100644
--- a/spec/commands/install_spec.rb
+++ b/spec/commands/install_spec.rb
@@ -405,7 +405,7 @@ RSpec.describe "bundle install with gem sources" do
expect(last_command.stdboth).not_to match(/Error Report/i)
expect(err).to include("An error occurred while installing ajp-rails (0.0.0), and Bundler cannot continue.").
- and include(normalize_uri_file("Make sure that `gem install ajp-rails -v '0.0.0' --source 'file://#{gem_repo2}/'` succeeds before bundling."))
+ and include("Make sure that `gem install ajp-rails -v '0.0.0' --source 'file://#{gem_repo2}/'` succeeds before bundling.")
end
it "doesn't blow up when the local .bundle/config is empty" do
diff --git a/spec/commands/lock_spec.rb b/spec/commands/lock_spec.rb
index e5b618a113..ba7b80ef95 100644
--- a/spec/commands/lock_spec.rb
+++ b/spec/commands/lock_spec.rb
@@ -19,7 +19,7 @@ RSpec.describe "bundle lock" do
gem "foo"
G
- @lockfile = strip_lockfile(normalize_uri_file(<<-L))
+ @lockfile = strip_lockfile(<<-L)
GEM
remote: file://#{repo}/
specs:
@@ -94,7 +94,7 @@ RSpec.describe "bundle lock" do
source "file://#{repo}"
gem "foo"
G
- lockfile = strip_lockfile(normalize_uri_file(<<-L))
+ lockfile = strip_lockfile(<<-L)
GEM
remote: file://#{repo}/
specs:
@@ -284,7 +284,7 @@ RSpec.describe "bundle lock" do
simulate_platform(mingw) { bundle! :lock }
- expect(the_bundle.lockfile).to read_as(normalize_uri_file(strip_whitespace(<<-G)))
+ expect(the_bundle.lockfile).to read_as(strip_whitespace(<<-G))
GEM
remote: file://#{gem_repo4}/
specs:
@@ -309,7 +309,7 @@ RSpec.describe "bundle lock" do
simulate_platform(rb) { bundle! :lock }
- expect(the_bundle.lockfile).to read_as(normalize_uri_file(strip_whitespace(<<-G)))
+ expect(the_bundle.lockfile).to read_as(strip_whitespace(<<-G))
GEM
remote: file://#{gem_repo4}/
specs:
diff --git a/spec/commands/post_bundle_message_spec.rb b/spec/commands/post_bundle_message_spec.rb
index 3437a7748c..1783560d94 100644
--- a/spec/commands/post_bundle_message_spec.rb
+++ b/spec/commands/post_bundle_message_spec.rb
@@ -116,7 +116,7 @@ RSpec.describe "post bundle message" do
gem "rack"
gem "not-a-gem", :group => :development
G
- expect(err).to include normalize_uri_file(<<-EOS.strip)
+ expect(err).to include <<-EOS.strip
Could not find gem 'not-a-gem' in rubygems repository file://#{gem_repo1}/ or installed locally.
The source does not contain any versions of 'not-a-gem'
EOS
diff --git a/spec/install/failure_spec.rb b/spec/install/failure_spec.rb
index d1b17c3515..659c943ad8 100644
--- a/spec/install/failure_spec.rb
+++ b/spec/install/failure_spec.rb
@@ -18,7 +18,7 @@ RSpec.describe "bundle install" do
source "file:\/\/localhost#{gem_repo2}"
gem "rails"
G
- expect(err).to end_with(normalize_uri_file(<<-M.strip))
+ expect(err).to end_with(<<-M.strip)
An error occurred while installing activesupport (2.3.2), and Bundler cannot continue.
Make sure that `gem install activesupport -v '2.3.2' --source 'file://#{gem_repo2}/'` succeeds before bundling.
@@ -111,7 +111,7 @@ In Gemfile:
gem "rails"
end
G
- expect(err).to end_with(normalize_uri_file(<<-M.strip))
+ expect(err).to end_with(<<-M.strip)
An error occurred while installing activesupport (2.3.2), and Bundler cannot continue.
Make sure that `gem install activesupport -v '2.3.2' --source 'file://#{gem_repo2}/'` succeeds before bundling.
diff --git a/spec/install/gemfile/gemspec_spec.rb b/spec/install/gemfile/gemspec_spec.rb
index ba475434a8..f8dde2d185 100644
--- a/spec/install/gemfile/gemspec_spec.rb
+++ b/spec/install/gemfile/gemspec_spec.rb
@@ -456,7 +456,7 @@ RSpec.describe "bundle install from an existing gemspec" do
context "as a runtime dependency" do
it "keeps java dependencies in the lockfile" do
expect(the_bundle).to include_gems "foo 1.0", "platform_specific 1.0 RUBY"
- expect(lockfile).to eq normalize_uri_file(strip_whitespace(<<-L))
+ expect(lockfile).to eq strip_whitespace(<<-L)
PATH
remote: .
specs:
@@ -487,7 +487,7 @@ RSpec.describe "bundle install from an existing gemspec" do
it "keeps java dependencies in the lockfile" do
expect(the_bundle).to include_gems "foo 1.0", "platform_specific 1.0 RUBY"
- expect(lockfile).to eq normalize_uri_file(strip_whitespace(<<-L))
+ expect(lockfile).to eq strip_whitespace(<<-L)
PATH
remote: .
specs:
@@ -519,7 +519,7 @@ RSpec.describe "bundle install from an existing gemspec" do
it "keeps java dependencies in the lockfile" do
expect(the_bundle).to include_gems "foo 1.0", "indirect_platform_specific 1.0", "platform_specific 1.0 RUBY"
- expect(lockfile).to eq normalize_uri_file(strip_whitespace(<<-L))
+ expect(lockfile).to eq strip_whitespace(<<-L)
PATH
remote: .
specs:
diff --git a/spec/install/gemfile/platform_spec.rb b/spec/install/gemfile/platform_spec.rb
index ec113a3772..abc1f2ab65 100644
--- a/spec/install/gemfile/platform_spec.rb
+++ b/spec/install/gemfile/platform_spec.rb
@@ -102,7 +102,7 @@ RSpec.describe "bundle install across platforms" do
gem "pry"
G
- expect(the_bundle.lockfile).to read_as normalize_uri_file(strip_whitespace(<<-L))
+ expect(the_bundle.lockfile).to read_as strip_whitespace(<<-L)
GEM
remote: file:///#{gem_repo4}/
specs:
@@ -160,7 +160,7 @@ RSpec.describe "bundle install across platforms" do
#{Bundler::VERSION}
L
- expect(the_bundle.lockfile).to read_as normalize_uri_file(good_lockfile)
+ expect(the_bundle.lockfile).to read_as good_lockfile
bad_lockfile = strip_whitespace <<-L
GEM
@@ -196,23 +196,23 @@ RSpec.describe "bundle install across platforms" do
aggregate_failures do
lockfile bad_lockfile
bundle! :install
- expect(the_bundle.lockfile).to read_as normalize_uri_file(good_lockfile)
+ expect(the_bundle.lockfile).to read_as good_lockfile
lockfile bad_lockfile
bundle! :update, :all => true
- expect(the_bundle.lockfile).to read_as normalize_uri_file(good_lockfile)
+ expect(the_bundle.lockfile).to read_as good_lockfile
lockfile bad_lockfile
bundle! "update ffi"
- expect(the_bundle.lockfile).to read_as normalize_uri_file(good_lockfile)
+ expect(the_bundle.lockfile).to read_as good_lockfile
lockfile bad_lockfile
bundle! "update empyrean"
- expect(the_bundle.lockfile).to read_as normalize_uri_file(good_lockfile)
+ expect(the_bundle.lockfile).to read_as good_lockfile
lockfile bad_lockfile
bundle! :lock
- expect(the_bundle.lockfile).to read_as normalize_uri_file(good_lockfile)
+ expect(the_bundle.lockfile).to read_as good_lockfile
end
end
diff --git a/spec/install/gemfile/sources_spec.rb b/spec/install/gemfile/sources_spec.rb
index f96180b0af..31a104565c 100644
--- a/spec/install/gemfile/sources_spec.rb
+++ b/spec/install/gemfile/sources_spec.rb
@@ -31,7 +31,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
bundle :install
expect(err).to include("Warning: the gem 'rack' was found in multiple sources.")
- expect(err).to include(normalize_uri_file("Installed from: file://#{gem_repo1}"))
+ expect(err).to include("Installed from: file://#{gem_repo1}")
expect(the_bundle).to include_gems("rack-obama 1.0.0", "rack 1.0.0", :source => "remote1")
end
@@ -58,7 +58,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
it "warns about ambiguous gems, but installs anyway", :bundler => "2" do
expect(err).to include("Warning: the gem 'rack' was found in multiple sources.")
- expect(err).to include(normalize_uri_file("Installed from: file://#{gem_repo1}"))
+ expect(err).to include("Installed from: file://#{gem_repo1}")
expect(the_bundle).to include_gems("rack-obama 1.0.0", "rack 1.0.0", :source => "remote1")
end
@@ -251,7 +251,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
it "installs from the other source and warns about ambiguous gems", :bundler => "2" do
expect(err).to include("Warning: the gem 'rack' was found in multiple sources.")
- expect(err).to include(normalize_uri_file("Installed from: file://#{gem_repo2}"))
+ expect(err).to include("Installed from: file://#{gem_repo2}")
expect(the_bundle).to include_gems("depends_on_rack 1.0.1", "rack 1.0.0")
end
@@ -674,7 +674,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
gem "depends_on_rack"
G
expect(last_command).to be_failure
- expect(err).to eq normalize_uri_file(strip_whitespace(<<-EOS).strip)
+ expect(err).to eq strip_whitespace(<<-EOS).strip
The gem 'rack' was found in multiple relevant sources.
* rubygems repository file://#{gem_repo1}/ or installed locally
* rubygems repository file://#{gem_repo4}/ or installed locally
diff --git a/spec/install/gems/mirror_spec.rb b/spec/install/gems/mirror_spec.rb
index 478cc058c3..7b18552fbc 100644
--- a/spec/install/gems/mirror_spec.rb
+++ b/spec/install/gems/mirror_spec.rb
@@ -13,7 +13,7 @@ RSpec.describe "bundle install with a mirror configured" do
it "installs from the normal location" do
bundle :install
- expect(out).to include(normalize_uri_file("Fetching source index from file://#{gem_repo1}"))
+ expect(out).to include("Fetching source index from file://#{gem_repo1}")
expect(the_bundle).to include_gems "rack 1.0"
end
end
@@ -31,8 +31,8 @@ RSpec.describe "bundle install with a mirror configured" do
it "installs the gem from the mirror" do
bundle :install
- expect(out).to include(normalize_uri_file("Fetching source index from file://#{gem_repo1}"))
- expect(out).not_to include(normalize_uri_file("Fetching source index from file://#{gem_repo2}"))
+ expect(out).to include("Fetching source index from file://#{gem_repo1}")
+ expect(out).not_to include("Fetching source index from file://#{gem_repo2}")
expect(the_bundle).to include_gems "rack 1.0"
end
end
diff --git a/spec/runtime/setup_spec.rb b/spec/runtime/setup_spec.rb
index 60a4c883c9..f03d7e028d 100644
--- a/spec/runtime/setup_spec.rb
+++ b/spec/runtime/setup_spec.rb
@@ -1152,7 +1152,7 @@ end
#{Bundler::VERSION}
L
- normalize_uri_file(lock)
+ lock
end
before do
diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb
index 4787900621..784e6e4062 100644
--- a/spec/support/helpers.rb
+++ b/spec/support/helpers.rb
@@ -279,7 +279,7 @@ module Spec
if contents.nil?
File.open("Gemfile.lock", "r", &:read)
else
- create_file("Gemfile.lock", normalize_uri_file(contents), *args)
+ create_file("Gemfile.lock", contents, *args)
end
end
@@ -289,10 +289,6 @@ module Spec
str.gsub(/^#{spaces}/, "")
end
- def normalize_uri_file(str)
- str
- end
-
def install_gemfile(*args)
gemfile(*args)
opts = args.last.is_a?(Hash) ? args.last : {}
diff --git a/spec/support/matchers.rb b/spec/support/matchers.rb
index 5d1a6a7919..b0493801e8 100644
--- a/spec/support/matchers.rb
+++ b/spec/support/matchers.rb
@@ -194,7 +194,7 @@ module Spec
RSpec::Matchers.alias_matcher :include_gem, :include_gems
def have_lockfile(expected)
- read_as(normalize_uri_file(strip_whitespace(expected)))
+ read_as(strip_whitespace(expected))
end
def plugin_should_be_installed(*names)