diff options
Diffstat (limited to 'spec/bundler/install/gemfile/path_spec.rb')
-rw-r--r-- | spec/bundler/install/gemfile/path_spec.rb | 45 |
1 files changed, 40 insertions, 5 deletions
diff --git a/spec/bundler/install/gemfile/path_spec.rb b/spec/bundler/install/gemfile/path_spec.rb index a1c41aebbb..f7789e7ea5 100644 --- a/spec/bundler/install/gemfile/path_spec.rb +++ b/spec/bundler/install/gemfile/path_spec.rb @@ -1,8 +1,7 @@ # frozen_string_literal: true -require "spec_helper" RSpec.describe "bundle install with explicit source paths" do - it "fetches gems" do + it "fetches gems with a global path source", :bundler => "< 2" do build_lib "foo" install_gemfile <<-G @@ -13,6 +12,18 @@ RSpec.describe "bundle install with explicit source paths" do expect(the_bundle).to include_gems("foo 1.0") end + it "fetches gems" do + build_lib "foo" + + install_gemfile <<-G + path "#{lib_path("foo-1.0")}" do + gem 'foo' + end + G + + expect(the_bundle).to include_gems("foo 1.0") + end + it "supports pinned paths" do build_lib "foo" @@ -79,7 +90,7 @@ RSpec.describe "bundle install with explicit source paths" do gem 'foo', :path => File.expand_path("../foo-1.0", __FILE__) G - bundle "install --frozen" + bundle! :install, forgotten_command_line_options(:frozen => true) expect(exitstatus).to eq(0) if exitstatus end @@ -270,8 +281,9 @@ RSpec.describe "bundle install with explicit source paths" do end install_gemfile <<-G - path "#{lib_path("foo-1.0")}" - gem 'foo' + path "#{lib_path("foo-1.0")}" do + gem 'foo' + end G expect(the_bundle).to include_gems "foo 1.0" @@ -591,5 +603,28 @@ RSpec.describe "bundle install with explicit source paths" do :requires => [lib_path("install_hooks.rb")] expect(out).to include("failed for foo-1.0") end + + it "loads plugins from the path gem" do + foo_file = home("foo_plugin_loaded") + bar_file = home("bar_plugin_loaded") + expect(foo_file).not_to be_file + expect(bar_file).not_to be_file + + build_lib "foo" do |s| + s.write("lib/rubygems_plugin.rb", "FileUtils.touch('#{foo_file}')") + end + + build_git "bar" do |s| + s.write("lib/rubygems_plugin.rb", "FileUtils.touch('#{bar_file}')") + end + + install_gemfile! <<-G + gem "foo", :path => "#{lib_path("foo-1.0")}" + gem "bar", :path => "#{lib_path("bar-1.0")}" + G + + expect(foo_file).to be_file + expect(bar_file).to be_file + end end end |