Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion spec/runtime/setup_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1309,7 +1309,12 @@ def lock_with(ruby_version = nil)
end

context "is not present" do
it "does not change the lock" do
# Skipped on ruby-core because `ruby "require 'bundler/setup'"` does not
# activate bundler as a gem there, so Source::Metadata falls back to a
# synthetic spec whose cache_file does not exist on disk and
# LockfileGenerator#bundler_checksum drops the bundler checksum, while
# the on-disk lockfile still has it.
it "does not change the lock", :ruby_repo do
expect { ruby "require 'bundler/setup'" }.not_to change { lockfile }
end
end
Expand Down
7 changes: 1 addition & 6 deletions spec/support/checksums.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,7 @@ def checksums_section(enabled = true, bundler_checksum: true, &block)
ChecksumsBuilder.new(enabled, &block).tap do |builder|
next if builder.bundler_registered || !bundler_checksum

# Mirror the conditions under which LockfileGenerator#bundler_checksum
# gives up and omits the bundler checksum from the lockfile:
# - .dev: development builds have no released bundler.gem to checksum.
# - ruby_core?: bundler is loaded as a default gem, so bundler.gem
# is not present on disk under the test gem cache.
next if Bundler::VERSION.to_s.end_with?(".dev") || Spec::Path.ruby_core?
next if Bundler::VERSION.to_s.end_with?(".dev")
builder.checksum(system_gem_path, "bundler", Bundler::VERSION, Gem::Platform::RUBY, "cache")
end
end
Expand Down
Loading