From c2e8e1f6a43b867c8e08efa55467bcabd0f6ab6b Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Tue, 4 Jan 2022 00:24:58 +0900 Subject: [rubygems/rubygems] Fix checksum Calculate the checksum of the content, not the given pathname at the build time itself. https://github.com/rubygems/rubygems/commit/b60ee97ee9 --- spec/bundler/bundler/gem_helper_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'spec/bundler') diff --git a/spec/bundler/bundler/gem_helper_spec.rb b/spec/bundler/bundler/gem_helper_spec.rb index 2c43719aa1..f1bb9861cf 100644 --- a/spec/bundler/bundler/gem_helper_spec.rb +++ b/spec/bundler/bundler/gem_helper_spec.rb @@ -169,6 +169,12 @@ RSpec.describe Bundler::GemHelper do end describe "#build_checksum" do + it "calculates SHA512 of the content" do + subject.build_checksum(Pathname(IO::NULL)) + sha_path = app_path.join("checksums", "#{File.basename(IO::NULL)}.sha512") + expect(File.read(sha_path)).to eql(Digest::SHA512.hexdigest("")) + end + context "when build was successful" do it "creates .sha512 file" do mock_build_message app_name, app_version -- cgit v1.2.3