diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2022-09-05 09:15:30 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2022-09-05 14:37:12 +0900 |
commit | 3eca1e438db6fabaa7cd5e5a7120da147ac0ec26 (patch) | |
tree | 597be042af7d0052616ba41bb9d0b8d8ceedd094 /spec/bundler/install/gemfile/sources_spec.rb | |
parent | 3767c6a90d8970f9b39e9ed116a7b9bbac3f9f26 (diff) | |
download | ruby-3eca1e438db6fabaa7cd5e5a7120da147ac0ec26.tar.gz |
Merge https://github.com/rubygems/rubygems/commit/16c3535413afebcdbab7582c6017c27b5da8a8dc
Diffstat (limited to 'spec/bundler/install/gemfile/sources_spec.rb')
-rw-r--r-- | spec/bundler/install/gemfile/sources_spec.rb | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/spec/bundler/install/gemfile/sources_spec.rb b/spec/bundler/install/gemfile/sources_spec.rb index ee0aa2a347..d2733993bb 100644 --- a/spec/bundler/install/gemfile/sources_spec.rb +++ b/spec/bundler/install/gemfile/sources_spec.rb @@ -1470,6 +1470,59 @@ RSpec.describe "bundle install with gems on multiple sources" do end end + context "when default source includes old gems with nil required_ruby_version" do + before do + build_repo2 do + build_gem "ruport", "1.7.0.3" do |s| + s.add_dependency "pdf-writer", "1.1.8" + end + end + + build_repo gem_repo4 do + build_gem "pdf-writer", "1.1.8" + end + + path = "#{gem_repo4}/#{Gem::MARSHAL_SPEC_DIR}/pdf-writer-1.1.8.gemspec.rz" + spec = Marshal.load(Bundler.rubygems.inflate(File.binread(path))) + spec.instance_variable_set(:@required_ruby_version, nil) + File.open(path, "wb") do |f| + f.write Gem.deflate(Marshal.dump(spec)) + end + + gemfile <<~G + source "https://localgemserver.test" + + gem "ruport", "= 1.7.0.3", :source => "https://localgemserver.test/extra" + G + end + + it "handles that fine" do + bundle "install", :artifice => "compact_index_extra", :env => { "BUNDLER_SPEC_GEM_REPO" => gem_repo4.to_s } + + expect(lockfile).to eq <<~L + GEM + remote: https://localgemserver.test/ + specs: + pdf-writer (1.1.8) + + GEM + remote: https://localgemserver.test/extra/ + specs: + ruport (1.7.0.3) + pdf-writer (= 1.1.8) + + PLATFORMS + #{specific_local_platform} + + DEPENDENCIES + ruport (= 1.7.0.3)! + + BUNDLED WITH + #{Bundler::VERSION} + L + end + end + context "when default source includes old gems with nil required_rubygems_version" do before do build_repo2 do |