diff options
Diffstat (limited to 'spec/bundler/runtime/setup_spec.rb')
-rw-r--r-- | spec/bundler/runtime/setup_spec.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/bundler/runtime/setup_spec.rb b/spec/bundler/runtime/setup_spec.rb index e98d462ee6..09f179c517 100644 --- a/spec/bundler/runtime/setup_spec.rb +++ b/spec/bundler/runtime/setup_spec.rb @@ -1650,4 +1650,34 @@ end expect(err).to include("net-imap is not part of the default gems") end + + it "calls #to_path on the name to require" do + build_repo4 do + build_gem "net-imap" do |s| + s.write "lib/net/imap.rb", "NET_IMAP = '0.0.1'" + end + build_gem "csv" + end + + install_gemfile <<-G + source "#{file_uri_for(gem_repo4)}" + gem "csv" + G + + ruby <<-R + Gem.send(:remove_const, :BUNDLED_GEMS) if defined?(Gem::BUNDLED_GEMS) + module Gem::BUNDLED_GEMS + SINCE = { "csv" => "1.0.0", "net-imap" => "0.0.1" } + end + path = BasicObject.new + def path.to_path; 'net/imap'; end + require 'bundler/setup' + begin + require path + rescue LoadError + end + R + + expect(err).to include("net-imap is not part of the default gems") + end end |