[rubygems/rubygems] Extract a build_repo3
helper
https://github.com/rubygems/rubygems/commit/d8cf4aa0cd
This commit is contained in:
parent
7d97dde2e2
commit
dc804bd83c
@ -162,7 +162,7 @@ RSpec.describe "bundle outdated" do
|
|||||||
build_gem "vcr", "6.0.0"
|
build_gem "vcr", "6.0.0"
|
||||||
end
|
end
|
||||||
|
|
||||||
build_repo gem_repo3 do
|
build_repo3 do
|
||||||
build_gem "pkg-gem-flowbyte-with-dep", "1.0.0" do |s|
|
build_gem "pkg-gem-flowbyte-with-dep", "1.0.0" do |s|
|
||||||
s.add_dependency "oj"
|
s.add_dependency "oj"
|
||||||
end
|
end
|
||||||
|
@ -409,7 +409,7 @@ RSpec.describe "bundle remove" do
|
|||||||
|
|
||||||
context "with sources" do
|
context "with sources" do
|
||||||
before do
|
before do
|
||||||
build_repo gem_repo3 do
|
build_repo3 do
|
||||||
build_gem "rspec"
|
build_gem "rspec"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -956,7 +956,7 @@ RSpec.describe "bundle update" do
|
|||||||
build_gem "vcr", "6.0.0"
|
build_gem "vcr", "6.0.0"
|
||||||
end
|
end
|
||||||
|
|
||||||
build_repo gem_repo3 do
|
build_repo3 do
|
||||||
build_gem "pkg-gem-flowbyte-with-dep", "1.0.0" do |s|
|
build_gem "pkg-gem-flowbyte-with-dep", "1.0.0" do |s|
|
||||||
s.add_dependency "oj"
|
s.add_dependency "oj"
|
||||||
end
|
end
|
||||||
|
@ -8,7 +8,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
|
|||||||
before do
|
before do
|
||||||
# Oh no! Someone evil is trying to hijack myrack :(
|
# Oh no! Someone evil is trying to hijack myrack :(
|
||||||
# need this to be broken to check for correct source ordering
|
# need this to be broken to check for correct source ordering
|
||||||
build_repo gem_repo3 do
|
build_repo3 do
|
||||||
build_gem "myrack", repo3_myrack_version do |s|
|
build_gem "myrack", repo3_myrack_version do |s|
|
||||||
s.write "lib/myrack.rb", "MYRACK = 'FAIL'"
|
s.write "lib/myrack.rb", "MYRACK = 'FAIL'"
|
||||||
end
|
end
|
||||||
@ -156,7 +156,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
|
|||||||
before do
|
before do
|
||||||
# Oh no! Someone evil is trying to hijack myrack :(
|
# Oh no! Someone evil is trying to hijack myrack :(
|
||||||
# need this to be broken to check for correct source ordering
|
# need this to be broken to check for correct source ordering
|
||||||
build_repo gem_repo3 do
|
build_repo3 do
|
||||||
build_gem "myrack", "1.0.0" do |s|
|
build_gem "myrack", "1.0.0" do |s|
|
||||||
s.write "lib/myrack.rb", "MYRACK = 'FAIL'"
|
s.write "lib/myrack.rb", "MYRACK = 'FAIL'"
|
||||||
end
|
end
|
||||||
@ -200,7 +200,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
|
|||||||
before do
|
before do
|
||||||
# Oh no! Someone evil is trying to hijack myrack :(
|
# Oh no! Someone evil is trying to hijack myrack :(
|
||||||
# need this to be broken to check for correct source ordering
|
# need this to be broken to check for correct source ordering
|
||||||
build_repo gem_repo3 do
|
build_repo3 do
|
||||||
build_gem "myrack", "1.0.0" do |s|
|
build_gem "myrack", "1.0.0" do |s|
|
||||||
s.write "lib/myrack.rb", "MYRACK = 'FAIL'"
|
s.write "lib/myrack.rb", "MYRACK = 'FAIL'"
|
||||||
end
|
end
|
||||||
@ -225,7 +225,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
|
|||||||
|
|
||||||
context "when a pinned gem has an indirect dependency in the pinned source" do
|
context "when a pinned gem has an indirect dependency in the pinned source" do
|
||||||
before do
|
before do
|
||||||
build_repo gem_repo3 do
|
build_repo3 do
|
||||||
build_gem "depends_on_myrack", "1.0.1" do |s|
|
build_gem "depends_on_myrack", "1.0.1" do |s|
|
||||||
s.add_dependency "myrack"
|
s.add_dependency "myrack"
|
||||||
end
|
end
|
||||||
@ -287,7 +287,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
|
|||||||
before do
|
before do
|
||||||
# In these tests, we need a working myrack gem in repo2 and not repo3
|
# In these tests, we need a working myrack gem in repo2 and not repo3
|
||||||
|
|
||||||
build_repo gem_repo3 do
|
build_repo3 do
|
||||||
build_gem "depends_on_myrack", "1.0.1" do |s|
|
build_gem "depends_on_myrack", "1.0.1" do |s|
|
||||||
s.add_dependency "myrack"
|
s.add_dependency "myrack"
|
||||||
end
|
end
|
||||||
@ -502,7 +502,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
|
|||||||
before do
|
before do
|
||||||
build_repo2
|
build_repo2
|
||||||
|
|
||||||
build_repo gem_repo3 do
|
build_repo3 do
|
||||||
build_gem "private_gem_1", "1.0.0"
|
build_gem "private_gem_1", "1.0.0"
|
||||||
build_gem "private_gem_2", "1.0.0"
|
build_gem "private_gem_2", "1.0.0"
|
||||||
end
|
end
|
||||||
@ -528,7 +528,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
|
|||||||
before do
|
before do
|
||||||
build_repo2
|
build_repo2
|
||||||
|
|
||||||
build_repo gem_repo3 do
|
build_repo3 do
|
||||||
build_gem "depends_on_missing", "1.0.1" do |s|
|
build_gem "depends_on_missing", "1.0.1" do |s|
|
||||||
s.add_dependency "missing"
|
s.add_dependency "missing"
|
||||||
end
|
end
|
||||||
@ -565,7 +565,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
build_repo gem_repo3 do
|
build_repo3 do
|
||||||
build_gem "unrelated_gem", "1.0.0"
|
build_gem "unrelated_gem", "1.0.0"
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -645,7 +645,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
|
|||||||
|
|
||||||
context "when a scoped gem has a deeply nested indirect dependency" do
|
context "when a scoped gem has a deeply nested indirect dependency" do
|
||||||
before do
|
before do
|
||||||
build_repo gem_repo3 do
|
build_repo3 do
|
||||||
build_gem "depends_on_depends_on_myrack", "1.0.1" do |s|
|
build_gem "depends_on_depends_on_myrack", "1.0.1" do |s|
|
||||||
s.add_dependency "depends_on_myrack"
|
s.add_dependency "depends_on_myrack"
|
||||||
end
|
end
|
||||||
@ -764,7 +764,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
|
|||||||
build_gem "zeitwerk", "2.4.2"
|
build_gem "zeitwerk", "2.4.2"
|
||||||
end
|
end
|
||||||
|
|
||||||
build_repo gem_repo3 do
|
build_repo3 do
|
||||||
build_gem "sidekiq-pro", "5.2.1" do |s|
|
build_gem "sidekiq-pro", "5.2.1" do |s|
|
||||||
s.add_dependency "connection_pool", ">= 2.2.3"
|
s.add_dependency "connection_pool", ">= 2.2.3"
|
||||||
s.add_dependency "sidekiq", ">= 6.1.0"
|
s.add_dependency "sidekiq", ">= 6.1.0"
|
||||||
@ -1080,7 +1080,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
|
|||||||
|
|
||||||
context "when a pinned gem has an indirect dependency with more than one level of indirection in the default source " do
|
context "when a pinned gem has an indirect dependency with more than one level of indirection in the default source " do
|
||||||
before do
|
before do
|
||||||
build_repo gem_repo3 do
|
build_repo3 do
|
||||||
build_gem "handsoap", "0.2.5.5" do |s|
|
build_gem "handsoap", "0.2.5.5" do |s|
|
||||||
s.add_dependency "nokogiri", ">= 1.2.3"
|
s.add_dependency "nokogiri", ">= 1.2.3"
|
||||||
end
|
end
|
||||||
@ -1157,7 +1157,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
|
|||||||
|
|
||||||
context "with a gem that is only found in the wrong source" do
|
context "with a gem that is only found in the wrong source" do
|
||||||
before do
|
before do
|
||||||
build_repo gem_repo3 do
|
build_repo3 do
|
||||||
build_gem "not_in_repo1", "1.0.0"
|
build_gem "not_in_repo1", "1.0.0"
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1250,7 +1250,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
before do
|
before do
|
||||||
build_repo gem_repo3 do
|
build_repo3 do
|
||||||
build_gem "myrack", "0.9.1"
|
build_gem "myrack", "0.9.1"
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1393,7 +1393,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
|
|||||||
context "re-resolving" do
|
context "re-resolving" do
|
||||||
context "when there is a mix of sources in the gemfile" do
|
context "when there is a mix of sources in the gemfile" do
|
||||||
before do
|
before do
|
||||||
build_repo gem_repo3 do
|
build_repo3 do
|
||||||
build_gem "myrack"
|
build_gem "myrack"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ RSpec.describe "bundle install" do
|
|||||||
|
|
||||||
describe "when prerelease gems are not available" do
|
describe "when prerelease gems are not available" do
|
||||||
it "still works" do
|
it "still works" do
|
||||||
build_repo gem_repo3 do
|
build_repo3 do
|
||||||
build_gem "myrack"
|
build_gem "myrack"
|
||||||
end
|
end
|
||||||
FileUtils.rm_rf Dir[gem_repo3("prerelease*")]
|
FileUtils.rm_rf Dir[gem_repo3("prerelease*")]
|
||||||
|
@ -454,7 +454,7 @@ RSpec.describe "major deprecations" do
|
|||||||
|
|
||||||
context "bundle install in frozen mode with a lockfile with a single rubygems section with multiple remotes" do
|
context "bundle install in frozen mode with a lockfile with a single rubygems section with multiple remotes" do
|
||||||
before do
|
before do
|
||||||
build_repo gem_repo3 do
|
build_repo3 do
|
||||||
build_gem "myrack", "0.9.1"
|
build_gem "myrack", "0.9.1"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -188,9 +188,15 @@ module Spec
|
|||||||
|
|
||||||
# A repo that has no pre-installed gems included. (The caller completely
|
# A repo that has no pre-installed gems included. (The caller completely
|
||||||
# determines the contents with the block.)
|
# determines the contents with the block.)
|
||||||
|
def build_repo3(**kwargs, &blk)
|
||||||
|
build_empty_repo gem_repo3, **kwargs, &blk
|
||||||
|
end
|
||||||
|
|
||||||
|
# Like build_repo3, this is a repo that has no pre-installed gems included.
|
||||||
|
# We have two different methods for situations where two different empty
|
||||||
|
# sources are needed.
|
||||||
def build_repo4(**kwargs, &blk)
|
def build_repo4(**kwargs, &blk)
|
||||||
FileUtils.rm_rf gem_repo4
|
build_empty_repo gem_repo4, **kwargs, &blk
|
||||||
build_repo(gem_repo4, **kwargs, &blk)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_repo4(&blk)
|
def update_repo4(&blk)
|
||||||
@ -307,6 +313,11 @@ module Spec
|
|||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
def build_empty_repo(gem_repo, **kwargs, &blk)
|
||||||
|
FileUtils.rm_rf gem_repo
|
||||||
|
build_repo(gem_repo, **kwargs, &blk)
|
||||||
|
end
|
||||||
|
|
||||||
def build_with(builder, name, args, &blk)
|
def build_with(builder, name, args, &blk)
|
||||||
@_build_path ||= nil
|
@_build_path ||= nil
|
||||||
@_build_repo ||= nil
|
@_build_repo ||= nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user