aboutsummaryrefslogtreecommitdiffstats
path: root/spec/bundler/fetcher/compact_index_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/bundler/fetcher/compact_index_spec.rb')
-rw-r--r--spec/bundler/fetcher/compact_index_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/bundler/fetcher/compact_index_spec.rb b/spec/bundler/fetcher/compact_index_spec.rb
index e3f36666..691e19f6 100644
--- a/spec/bundler/fetcher/compact_index_spec.rb
+++ b/spec/bundler/fetcher/compact_index_spec.rb
@@ -25,6 +25,22 @@ describe Bundler::Fetcher::CompactIndex do
compact_index.specs_for_names(["lskdjf"])
end
+ describe "#available?" do
+ context "when OpenSSL is in FIPS mode", :ruby => ">= 2.0.0" do
+ before { stub_const("OpenSSL::OPENSSL_FIPS", true) }
+
+ it "returns false" do
+ expect(compact_index).to_not be_available
+ end
+
+ it "never requires digest/md5" do
+ expect(Kernel).to receive(:require).with("digest/md5").never
+
+ compact_index.available?
+ end
+ end
+ end
+
context "logging" do
before { allow(compact_index).to receive(:log_specs).and_call_original }