Skip to content

Commit

Permalink
[rubygems/rubygems] Bump rake version used by tests
Browse files Browse the repository at this point in the history
And make it easier to update next time.

rubygems/rubygems@1ea4bfa5d8
  • Loading branch information
deivid-rodriguez authored and matzbot committed Dec 12, 2023
1 parent 278ce27 commit 67940b1
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 31 deletions.
30 changes: 15 additions & 15 deletions spec/bundler/commands/lock_spec.rb
Expand Up @@ -19,7 +19,7 @@
c.checksum repo, "activesupport", "2.3.2"
c.checksum repo, "foo", "1.0"
c.checksum repo, "rails", "2.3.2"
c.checksum repo, "rake", "13.0.1"
c.checksum repo, "rake", rake_version
c.checksum repo, "weakling", "0.0.3"
end

Expand All @@ -42,8 +42,8 @@
actionpack (= 2.3.2)
activerecord (= 2.3.2)
activeresource (= 2.3.2)
rake (= 13.0.1)
rake (13.0.1)
rake (= #{rake_version})
rake (#{rake_version})
weakling (0.0.3)
PLATFORMS
Expand Down Expand Up @@ -201,7 +201,7 @@
c.checksum repo, "activesupport", "2.3.2"
c.checksum repo, "foo", "1.0"
c.checksum repo, "rails", "2.3.2"
c.checksum repo, "rake", "13.0.1"
c.checksum repo, "rake", rake_version
c.checksum repo, "weakling", "0.0.3"
end

Expand All @@ -224,8 +224,8 @@
actionpack (= 2.3.2)
activerecord (= 2.3.2)
activeresource (= 2.3.2)
rake (= 13.0.1)
rake (13.0.1)
rake (= #{rake_version})
rake (#{rake_version})
weakling (0.0.3)
PLATFORMS
Expand All @@ -245,11 +245,11 @@
end

it "update specific gems using --update" do
lockfile @lockfile.gsub("2.3.2", "2.3.1").gsub("13.0.1", "10.0.1")
lockfile @lockfile.gsub("2.3.2", "2.3.1").gsub(rake_version, "10.0.1")

bundle "lock --update rails rake"

expect(read_lockfile).to eq(remove_checksums_from_lockfile(@lockfile, "(2.3.2)", "(13.0.1)"))
expect(read_lockfile).to eq(remove_checksums_from_lockfile(@lockfile, "(2.3.2)", "(#{rake_version})"))
end

it "preserves unknown checksum algorithms" do
Expand Down Expand Up @@ -315,7 +315,7 @@

bundle "lock --update rake --verbose"
expect(out).to match(/Writing lockfile to.+lock/)
expect(lockfile).to include("rake (13.0.1)")
expect(lockfile).to include("rake (#{rake_version})")
end

it "errors when updating a missing specific gems using --update" do
Expand Down Expand Up @@ -1005,7 +1005,7 @@
c.checksum repo, "activesupport", "2.3.2"
c.checksum repo, "foo", "1.0"
c.checksum repo, "rails", "2.3.2"
c.checksum repo, "rake", "13.0.1"
c.checksum repo, "rake", rake_version
c.checksum repo, "weakling", "0.0.3"
end

Expand All @@ -1028,8 +1028,8 @@
actionpack (= 2.3.2)
activerecord (= 2.3.2)
activeresource (= 2.3.2)
rake (= 13.0.1)
rake (13.0.1)
rake (= #{rake_version})
rake (#{rake_version})
weakling (0.0.3)
PLATFORMS
Expand Down Expand Up @@ -1059,7 +1059,7 @@
c.checksum repo, "activesupport", "2.3.2"
c.no_checksum "foo", "2.0"
c.checksum repo, "rails", "2.3.2"
c.checksum repo, "rake", "13.0.1"
c.checksum repo, "rake", rake_version
c.checksum repo, "weakling", "0.0.3"
end

Expand All @@ -1082,8 +1082,8 @@
actionpack (= 2.3.2)
activerecord (= 2.3.2)
activeresource (= 2.3.2)
rake (= 13.0.1)
rake (13.0.1)
rake (= #{rake_version})
rake (#{rake_version})
weakling (0.0.3)
PLATFORMS
Expand Down
4 changes: 2 additions & 2 deletions spec/bundler/commands/newgem_spec.rb
Expand Up @@ -456,7 +456,7 @@ def bundle_exec_standardrb

prepare_gemspec(bundled_app("newgem", "newgem.gemspec"))

gems = ["rake-13.0.1"]
gems = ["rake-#{rake_version}"]
path = Bundler.feature_flag.default_install_uses_path? ? local_gem_path(base: bundled_app("newgem")) : system_gem_path
system_gems gems, path: path
bundle "exec rake build", dir: bundled_app("newgem")
Expand Down Expand Up @@ -649,7 +649,7 @@ def create_temporary_dir(dir)
it "runs rake without problems" do
bundle "gem #{gem_name}"

system_gems ["rake-13.0.1"]
system_gems ["rake-#{rake_version}"]

rakefile = <<~RAKEFILE
task :default do
Expand Down
2 changes: 1 addition & 1 deletion spec/bundler/commands/show_spec.rb
Expand Up @@ -57,7 +57,7 @@
it "prints path of all gems in bundle sorted by name" do
bundle "show --paths"

expect(out).to include(default_bundle_path("gems", "rake-13.0.1").to_s)
expect(out).to include(default_bundle_path("gems", "rake-#{rake_version}").to_s)
expect(out).to include(default_bundle_path("gems", "rails-2.3.2").to_s)

# Gem names are the last component of their path.
Expand Down
2 changes: 1 addition & 1 deletion spec/bundler/install/gemfile/gemspec_spec.rb
Expand Up @@ -147,7 +147,7 @@ def x64_mingw_checksums(checksums)
build_lib("foo", path: tmp.join("foo")) do |s|
s.write("Gemfile", "source '#{file_uri_for(gem_repo1)}'\ngemspec")
s.add_dependency "actionpack", "=2.3.2"
s.add_development_dependency "rake", "=13.0.1"
s.add_development_dependency "rake", rake_version
end

bundle "install", dir: tmp.join("foo")
Expand Down
8 changes: 4 additions & 4 deletions spec/bundler/install/gemfile/path_spec.rb
Expand Up @@ -771,26 +771,26 @@

build_lib "foo", "1.0", path: lib_path("foo") do |s|
s.add_dependency "rack"
s.add_dependency "rake", "13.0.1"
s.add_dependency "rake", rake_version
end

bundle "install"

checksums.checksum gem_repo1, "rake", "13.0.1"
checksums.checksum gem_repo1, "rake", rake_version

expect(lockfile).to eq <<~G
PATH
remote: #{lib_path("foo")}
specs:
foo (1.0)
rack
rake (= 13.0.1)
rake (= #{rake_version})
GEM
remote: #{file_uri_for(gem_repo1)}/
specs:
rack (0.9.1)
rake (13.0.1)
rake (#{rake_version})
PLATFORMS
#{lockfile_platforms}
Expand Down
2 changes: 1 addition & 1 deletion spec/bundler/install/gems/compact_index_spec.rb
Expand Up @@ -1050,7 +1050,7 @@ def start
source "#{source_uri}"
gem "rails"
G
deps = [Gem::Dependency.new("rake", "= 13.0.1"),
deps = [Gem::Dependency.new("rake", "= #{rake_version}"),
Gem::Dependency.new("actionpack", "= 2.3.2"),
Gem::Dependency.new("activerecord", "= 2.3.2"),
Gem::Dependency.new("actionmailer", "= 2.3.2"),
Expand Down
6 changes: 3 additions & 3 deletions spec/bundler/lock/lockfile_spec.rb
Expand Up @@ -873,7 +873,7 @@
c.checksum gem_repo2, "activeresource", "2.3.2"
c.checksum gem_repo2, "activesupport", "2.3.2"
c.checksum gem_repo2, "rails", "2.3.2"
c.checksum gem_repo2, "rake", "13.0.1"
c.checksum gem_repo2, "rake", rake_version
end

expect(lockfile).to eq <<~G
Expand All @@ -894,8 +894,8 @@
actionpack (= 2.3.2)
activerecord (= 2.3.2)
activeresource (= 2.3.2)
rake (= 13.0.1)
rake (13.0.1)
rake (= #{rake_version})
rake (#{rake_version})
PLATFORMS
#{lockfile_platforms}
Expand Down
4 changes: 2 additions & 2 deletions spec/bundler/runtime/inline_spec.rb
Expand Up @@ -421,11 +421,11 @@ def confirm(msg, newline = nil)
script <<-RUBY
gemfile(true) do
source "#{file_uri_for(gem_repo1)}"
gem "rake", "~> 13.0"
gem "rake", "#{rake_version}"
end
RUBY

expect(out).to include("Installing rake 13.0")
expect(out).to include("Installing rake #{rake_version}")
expect(out).not_to include("was 11.3.0")
expect(err).to be_empty
end
Expand Down
2 changes: 1 addition & 1 deletion spec/bundler/runtime/setup_spec.rb
Expand Up @@ -158,7 +158,7 @@ def clean_load_path(lp)
"/gems/actionpack-2.3.2/lib",
"/gems/actionmailer-2.3.2/lib",
"/gems/activesupport-2.3.2/lib",
"/gems/rake-13.0.1/lib"
"/gems/rake-#{rake_version}/lib"
)
end

Expand Down
6 changes: 5 additions & 1 deletion spec/bundler/support/builders.rb
Expand Up @@ -17,6 +17,10 @@ def pl(platform)
Gem::Platform.new(platform)
end

def rake_version
"13.1.0"
end

def build_repo1
rake_path = Dir["#{Path.base_system_gems}/**/rake*.gem"].first

Expand Down Expand Up @@ -49,7 +53,7 @@ def build_repo1

build_gem "rails", "2.3.2" do |s|
s.executables = "rails"
s.add_dependency "rake", "13.0.1"
s.add_dependency "rake", rake_version
s.add_dependency "actionpack", "2.3.2"
s.add_dependency "activerecord", "2.3.2"
s.add_dependency "actionmailer", "2.3.2"
Expand Down

0 comments on commit 67940b1

Please sign in to comment.