diff options
author | Jean Boussier <jean.boussier@gmail.com> | 2021-10-18 10:12:39 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-10-25 20:24:32 +0900 |
commit | 5af3f7f3574c16ec76fb44b21beec17a74f4417a (patch) | |
tree | 74466c2e744de33d146930dc711d37ab1853ecb0 /spec/bundler/bundler/digest_spec.rb | |
parent | 86e3d77abb8a033650937710d1ab009e98647494 (diff) |
[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
Diffstat (limited to 'spec/bundler/bundler/digest_spec.rb')
-rw-r--r-- | spec/bundler/bundler/digest_spec.rb | 17 |
1 files changed, 17 insertions, 0 deletions
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 |