diff options
author | Andre Arko <andre@arko.net> | 2015-12-13 20:17:56 +0800 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2015-12-13 20:17:56 +0800 |
commit | 4c8a0f479ee9da79019907de43f7414bf820b250 (patch) | |
tree | 128d51df9830e323a9d647ed4af363b6804bb77e | |
parent | 0113309648da399e59f9ea67a0500af49818ed7b (diff) | |
download | bundler-4c8a0f479ee9da79019907de43f7414bf820b250.tar.gz |
fix #4149 by (again) waiting to load Psych
also add a new test specifically to catch if Psych is ever loaded by
bundler/setup in the future
-rw-r--r-- | lib/bundler/rubygems_integration.rb | 2 | ||||
-rw-r--r-- | spec/runtime/setup_spec.rb | 15 |
2 files changed, 16 insertions, 1 deletions
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb index e5bd850743..f40b40b1de 100644 --- a/lib/bundler/rubygems_integration.rb +++ b/lib/bundler/rubygems_integration.rb @@ -1,7 +1,6 @@ require "monitor" require "rubygems" require "rubygems/config_file" -require "bundler/psyched_yaml" module Bundler class RubygemsIntegration @@ -63,6 +62,7 @@ module Bundler end def configuration + require "bundler/psyched_yaml" Gem.configuration rescue Gem::SystemExitException => e Bundler.ui.error "#{e.class}: #{e.message}" diff --git a/spec/runtime/setup_spec.rb b/spec/runtime/setup_spec.rb index 4f0d395342..7e205ca59a 100644 --- a/spec/runtime/setup_spec.rb +++ b/spec/runtime/setup_spec.rb @@ -954,4 +954,19 @@ describe "Bundler.setup" do end end end + + describe "when Psych is not in the Gemfile", :ruby => "~> 2.2" do + it "does not load Psych" do + gemfile "" + ruby <<-RUBY + require 'bundler/setup' + puts defined?(Psych::VERSION) ? Psych::VERSION : "undefined" + require 'psych' + puts Psych::VERSION + RUBY + pre_bundler, post_bundler = out.split("\n") + expect(pre_bundler).to eq("undefined") + expect(post_bundler).to match(/\d+\.\d+\.\d+/) + end + end end |