diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2021-11-11 23:58:40 +0100 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2021-12-03 20:00:50 +0900 |
commit | 248fae0ec43c2df6d9b545acc7f56bdfd5f89dec (patch) | |
tree | 1aaabdcb798992c18c1fa0fa5004fa99fb92416e /spec | |
parent | 7d974cc56fa0555beed0bf4f6fe34322cd24cd26 (diff) |
[rubygems/rubygems] Improve sources representation
We have two representations of a source. Once used for sorting, which
should not depend on the source's state, but solely on its static
information, like remotes. Another one used for error and informational
messages, which should properly inform about the exact state of the
source when the message is printed.
This commit makes the latter be the default implementation of `to_s`, so
that error and informational messages are more accurate by default.
https://github.com/rubygems/rubygems/commit/b5f2b88957
Diffstat (limited to 'spec')
-rw-r--r-- | spec/bundler/install/gemfile/sources_spec.rb | 8 | ||||
-rw-r--r-- | spec/bundler/support/indexes.rb | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/spec/bundler/install/gemfile/sources_spec.rb b/spec/bundler/install/gemfile/sources_spec.rb index 7a0c148254..5456e95f33 100644 --- a/spec/bundler/install/gemfile/sources_spec.rb +++ b/spec/bundler/install/gemfile/sources_spec.rb @@ -1336,8 +1336,8 @@ RSpec.describe "bundle install with gems on multiple sources" do G expect(err).to eq strip_whitespace(<<-EOS).strip Warning: The gem 'rack' was found in multiple relevant sources. - * rubygems repository https://gem.repo1/ or installed locally - * rubygems repository https://gem.repo4/ or installed locally + * rubygems repository https://gem.repo1/ + * rubygems repository https://gem.repo4/ You should add this gem to the source block for the source you wish it to be installed from. EOS expect(last_command).to be_success @@ -1366,8 +1366,8 @@ RSpec.describe "bundle install with gems on multiple sources" do expect(last_command).to be_failure expect(err).to eq strip_whitespace(<<-EOS).strip The gem 'rack' was found in multiple relevant sources. - * rubygems repository https://gem.repo1/ or installed locally - * rubygems repository https://gem.repo4/ or installed locally + * rubygems repository https://gem.repo1/ + * rubygems repository https://gem.repo4/ You must add this gem to the source block for the source you wish it to be installed from. EOS expect(the_bundle).not_to be_locked diff --git a/spec/bundler/support/indexes.rb b/spec/bundler/support/indexes.rb index 91dd699b5f..638f394e76 100644 --- a/spec/bundler/support/indexes.rb +++ b/spec/bundler/support/indexes.rb @@ -17,7 +17,7 @@ module Spec def resolve(args = []) @platforms ||= ["ruby"] deps = [] - default_source = instance_double("Bundler::Source::Rubygems", :specs => @index, :to_err => "locally install gems") + default_source = instance_double("Bundler::Source::Rubygems", :specs => @index, :to_s => "locally install gems") source_requirements = { :default => default_source } @deps.each do |d| source_requirements[d.name] = d.source = default_source |