From 5af3f7f3574c16ec76fb44b21beec17a74f4417a Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Mon, 18 Oct 2021 10:12:39 +0200 Subject: [rubygems/rubygems] Vendor a pure ruby implementation of SHA1 This allows `Source::Git` to no longer load the `digest` gem as it is causing issues on Ruby 3.1. https://github.com/rubygems/rubygems/pull/4989/commits/c19a9f2ff7 --- spec/bundler/bundler/digest_spec.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 spec/bundler/bundler/digest_spec.rb (limited to 'spec/bundler/bundler') diff --git a/spec/bundler/bundler/digest_spec.rb b/spec/bundler/bundler/digest_spec.rb new file mode 100644 index 0000000000..d6bb043fd0 --- /dev/null +++ b/spec/bundler/bundler/digest_spec.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +require "digest" +require "bundler/digest" + +RSpec.describe Bundler::Digest do + context "SHA1" do + subject { Bundler::Digest } + let(:stdlib) { ::Digest::SHA1 } + + it "is compatible with stdlib" do + ["foo", "skfjsdlkfjsdf", "3924m", "ldskfj"].each do |payload| + expect(subject.sha1(payload)).to be == stdlib.hexdigest(payload) + end + end + end +end -- cgit v1.2.3