diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-01-04 00:24:58 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2022-01-04 14:59:16 +0900 |
commit | c2e8e1f6a43b867c8e08efa55467bcabd0f6ab6b (patch) | |
tree | 6849d564a5ae5c8da86260291602b37b419b0fd4 /spec/bundler/bundler | |
parent | 67612dadbca5ddeba1c979e4838739bf7430a7cf (diff) |
[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
Diffstat (limited to 'spec/bundler/bundler')
-rw-r--r-- | spec/bundler/bundler/gem_helper_spec.rb | 6 |
1 files changed, 6 insertions, 0 deletions
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 |