diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2017-02-01 14:52:08 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2017-02-14 15:37:28 +0900 |
commit | b32860c020f80b463b2b3b4a11eb5b8b185b292b (patch) | |
tree | 08be69fdc82c9b3797b9e09ac93c258d998f97e6 /spec/runtime/setup_spec.rb | |
parent | 8c0cbf3c03a56b8cdfeaba2558c35f461608b287 (diff) | |
download | bundler-topic/defer-requiring-rubygems-spec_fetcher.tar.gz |
Defer requiring rubygems/spec_fetcher until it becomes necessarytopic/defer-requiring-rubygems-spec_fetcher
Avoid conflict between two versions of openssl gem on 'bundle exec' if
a newer and non-default version of openssl gem is installed to the
system. rubygems/spec_fetcher loads openssl through resolv and
securerandom when running with Ruby <= 2.4.
This is not a proper fix for #5235 as other standard libraries that
Bundler currently loads will be gemified as well in Ruby >= 2.5,
however, this will fix openssl's case.
Reference: https://github.com/bundler/bundler/issues/5235
Fixes: https://github.com/ruby/openssl/issues/103
Diffstat (limited to 'spec/runtime/setup_spec.rb')
-rw-r--r-- | spec/runtime/setup_spec.rb | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/spec/runtime/setup_spec.rb b/spec/runtime/setup_spec.rb index 09e88630..cca63261 100644 --- a/spec/runtime/setup_spec.rb +++ b/spec/runtime/setup_spec.rb @@ -1080,8 +1080,8 @@ RSpec.describe "Bundler.setup" do end end - describe "when Psych is not in the Gemfile", :ruby => "~> 2.2" do - it "does not load Psych" do + describe "with gemified standard libraries" do + it "does not load Psych", :ruby => "~> 2.2" do gemfile "" ruby <<-RUBY require 'bundler/setup' @@ -1093,6 +1093,17 @@ RSpec.describe "Bundler.setup" do expect(pre_bundler).to eq("undefined") expect(post_bundler).to match(/\d+\.\d+\.\d+/) end + + it "does not load openssl" do + install_gemfile! "" + ruby! <<-RUBY + require "bundler/setup" + puts defined?(OpenSSL) ? "FAIL" : "WIN" + require "openssl" + puts defined?(OpenSSL) ? "WIN" : "FAIL" + RUBY + expect(out).to eq("WIN\nWIN") + end end describe "after setup" do |