diff options
Diffstat (limited to 'spec/bundler/install/path_spec.rb')
-rw-r--r-- | spec/bundler/install/path_spec.rb | 75 |
1 files changed, 20 insertions, 55 deletions
diff --git a/spec/bundler/install/path_spec.rb b/spec/bundler/install/path_spec.rb index 0947ed9539..b2a3375342 100644 --- a/spec/bundler/install/path_spec.rb +++ b/spec/bundler/install/path_spec.rb @@ -113,71 +113,36 @@ RSpec.describe "bundle install" do expect(the_bundle).to include_gems "rack 1.0.0" end - context "with global_path_appends_ruby_scope set", :bundler => "3" do - it "installs gems to ." do - set_bundle_path(type, ".") - bundle! "config set --global disable_shared_gems true" + it "installs gems to ." do + set_bundle_path(type, ".") + bundle! "config set --global disable_shared_gems true" - bundle! :install - - paths_to_exist = %w[cache/rack-1.0.0.gem gems/rack-1.0.0 specifications/rack-1.0.0.gemspec].map {|path| bundled_app(Bundler.ruby_scope, path) } - expect(paths_to_exist).to all exist - expect(the_bundle).to include_gems "rack 1.0.0" - end - - it "installs gems to the path" do - set_bundle_path(type, bundled_app("vendor").to_s) - - bundle! :install + bundle! :install - expect(bundled_app("vendor", Bundler.ruby_scope, "gems/rack-1.0.0")).to be_directory - expect(the_bundle).to include_gems "rack 1.0.0" - end + paths_to_exist = %w[cache/rack-1.0.0.gem gems/rack-1.0.0 specifications/rack-1.0.0.gemspec].map {|path| bundled_app(Bundler.ruby_scope, path) } + expect(paths_to_exist).to all exist + expect(the_bundle).to include_gems "rack 1.0.0" + end - it "installs gems to the path relative to root when relative" do - set_bundle_path(type, "vendor") + it "installs gems to the path" do + set_bundle_path(type, bundled_app("vendor").to_s) - FileUtils.mkdir_p bundled_app("lol") - Dir.chdir(bundled_app("lol")) do - bundle! :install - end + bundle! :install - expect(bundled_app("vendor", Bundler.ruby_scope, "gems/rack-1.0.0")).to be_directory - expect(the_bundle).to include_gems "rack 1.0.0" - end + expect(bundled_app("vendor", Bundler.ruby_scope, "gems/rack-1.0.0")).to be_directory + expect(the_bundle).to include_gems "rack 1.0.0" end - context "with global_path_appends_ruby_scope unset", :bundler => "< 3" do - it "installs gems to ." do - set_bundle_path(type, ".") - bundle! "config set --global disable_shared_gems true" + it "installs gems to the path relative to root when relative" do + set_bundle_path(type, "vendor") + FileUtils.mkdir_p bundled_app("lol") + Dir.chdir(bundled_app("lol")) do bundle! :install - - expect([bundled_app("cache/rack-1.0.0.gem"), bundled_app("gems/rack-1.0.0"), bundled_app("specifications/rack-1.0.0.gemspec")]).to all exist - expect(the_bundle).to include_gems "rack 1.0.0" - end - - it "installs gems to BUNDLE_PATH with #{type}" do - set_bundle_path(type, bundled_app("vendor").to_s) - - bundle :install - - expect(bundled_app("vendor/gems/rack-1.0.0")).to be_directory - expect(the_bundle).to include_gems "rack 1.0.0" end - it "installs gems to BUNDLE_PATH relative to root when relative" do - set_bundle_path(type, "vendor") - - FileUtils.mkdir_p bundled_app("lol") - Dir.chdir(bundled_app("lol")) do - bundle :install - end - - expect(bundled_app("vendor/gems/rack-1.0.0")).to be_directory - expect(the_bundle).to include_gems "rack 1.0.0" - end + expect(bundled_app("vendor", Bundler.ruby_scope, "gems/rack-1.0.0")).to be_directory + expect(the_bundle).to include_gems "rack 1.0.0" end end end @@ -226,7 +191,7 @@ RSpec.describe "bundle install" do vendored_gems("extensions").rmtree run "require 'very_simple_binary_c'" - expect(last_command.stderr).to include("Bundler::GemNotFound") + expect(err).to include("Bundler::GemNotFound") bundle :install, forgotten_command_line_options(:path => "./vendor/bundle") |