diff options
author | Daniel Niknam <mhmd.niknam@gmail.com> | 2021-07-25 01:27:02 +1000 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-07-27 09:25:57 +0900 |
commit | 2f9e0cf1819b8679abe79494f622e1a42d7e021d (patch) | |
tree | 6ea1693b78ff3769dde6f7c5a24d2547c26f755e /spec/bundler/install/gemfile/path_spec.rb | |
parent | b500e8fab445d5a4ad91fd71e622aff88d0c7dd6 (diff) |
[rubygems/rubygems] Explicitly define a global source for tests
This is in preparation for deprecating source-less gemfiles.
https://github.com/rubygems/rubygems/commit/d6493fa3e2
Diffstat (limited to 'spec/bundler/install/gemfile/path_spec.rb')
-rw-r--r-- | spec/bundler/install/gemfile/path_spec.rb | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/spec/bundler/install/gemfile/path_spec.rb b/spec/bundler/install/gemfile/path_spec.rb index 1c77b3a37e..566fdcf65a 100644 --- a/spec/bundler/install/gemfile/path_spec.rb +++ b/spec/bundler/install/gemfile/path_spec.rb @@ -16,6 +16,7 @@ RSpec.describe "bundle install with explicit source paths" do build_lib "foo" install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" path "#{lib_path("foo-1.0")}" do gem 'foo' end @@ -28,6 +29,7 @@ RSpec.describe "bundle install with explicit source paths" do build_lib "foo" install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem 'foo', :path => "#{lib_path("foo-1.0")}" G @@ -40,6 +42,7 @@ RSpec.describe "bundle install with explicit source paths" do relative_path = lib_path("foo-1.0").relative_path_from(bundled_app) install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem 'foo', :path => "#{relative_path}" G @@ -52,6 +55,7 @@ RSpec.describe "bundle install with explicit source paths" do relative_path = lib_path("foo-1.0").relative_path_from(Pathname.new("~").expand_path) install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem 'foo', :path => "~/#{relative_path}" G @@ -66,6 +70,7 @@ RSpec.describe "bundle install with explicit source paths" do relative_path = lib_path("foo-1.0").relative_path_from(Pathname.new("/home/#{username}").expand_path) install_gemfile <<-G, :raise_on_error => false + source "#{file_uri_for(gem_repo1)}" gem 'foo', :path => "~#{username}/#{relative_path}" G expect(err).to match("There was an error while trying to use the path `~#{username}/#{relative_path}`.") @@ -76,6 +81,7 @@ RSpec.describe "bundle install with explicit source paths" do build_lib "foo", :path => bundled_app("foo-1.0") install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem 'foo', :path => "./foo-1.0" G @@ -87,6 +93,7 @@ RSpec.describe "bundle install with explicit source paths" do build_lib "aaa", :path => lib_path("demo/aaa") gemfile = <<-G + source "#{file_uri_for(gem_repo1)}" gemspec gem "aaa", :path => "./aaa" G @@ -105,6 +112,7 @@ RSpec.describe "bundle install with explicit source paths" do aaa (1.0) GEM + remote: #{file_uri_for(gem_repo1)}/ specs: PLATFORMS @@ -128,6 +136,7 @@ RSpec.describe "bundle install with explicit source paths" do build_lib "foo", :path => bundled_app("foo-1.0") install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem 'foo', :path => File.expand_path("../foo-1.0", __FILE__) G @@ -167,6 +176,7 @@ RSpec.describe "bundle install with explicit source paths" do build_lib "foo", "1.0.0", :path => lib_path("omg/foo") install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "omg", :path => "#{lib_path("omg")}" G @@ -177,6 +187,7 @@ RSpec.describe "bundle install with explicit source paths" do build_lib "omg", "2.0", :path => lib_path("omg") install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "omg", :path => "#{lib_path("omg")}" G @@ -200,6 +211,7 @@ RSpec.describe "bundle install with explicit source paths" do end install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "premailer", :path => "#{lib_path("premailer")}" G @@ -221,6 +233,7 @@ RSpec.describe "bundle install with explicit source paths" do end install_gemfile <<-G, :raise_on_error => false + source "#{file_uri_for(gem_repo1)}" gem "foo", :path => "#{lib_path("foo-1.0")}" G @@ -304,6 +317,7 @@ RSpec.describe "bundle install with explicit source paths" do end install_gemfile <<-G, :raise_on_error => false + source "#{file_uri_for(gem_repo1)}" gemspec :path => "#{lib_path("foo")}" G @@ -317,6 +331,7 @@ RSpec.describe "bundle install with explicit source paths" do end install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gemspec :path => "#{lib_path("foo")}", :name => "foo" G @@ -329,6 +344,7 @@ RSpec.describe "bundle install with explicit source paths" do end install_gemfile <<-G, :verbose => true + source "#{file_uri_for(gem_repo1)}" path "#{lib_path("foo-1.0")}" do gem 'foo' end @@ -346,6 +362,7 @@ RSpec.describe "bundle install with explicit source paths" do lib_path("foo-1.0").join("bin/performance").mkpath install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem 'foo', '1.0', :path => "#{lib_path("foo-1.0")}" G expect(err).to be_empty @@ -355,6 +372,7 @@ RSpec.describe "bundle install with explicit source paths" do build_lib "foo" install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem 'foo', :path => "#{lib_path("foo-1.0")}" G @@ -367,6 +385,7 @@ RSpec.describe "bundle install with explicit source paths" do build_lib "hi2u" install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" path "#{lib_path}" do gem "omg" gem "hi2u" @@ -385,6 +404,7 @@ RSpec.describe "bundle install with explicit source paths" do end install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "foo", :path => "#{lib_path("foo")}" gem "omg", :path => "#{lib_path("omg")}" G @@ -396,6 +416,7 @@ RSpec.describe "bundle install with explicit source paths" do build_lib "foo", :gemspec => false gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "foo", "1.0", :path => "#{lib_path("foo-1.0")}" G @@ -411,12 +432,13 @@ RSpec.describe "bundle install with explicit source paths" do specs: GEM - remote: http://rubygems.org + remote: http://rubygems.org/ L FileUtils.mkdir_p(bundled_app("vendor/bar")) install_gemfile <<-G + source "http://rubygems.org" gem "bar", "1.0.0", path: "vendor/bar", require: "bar/nyard" G end @@ -461,6 +483,7 @@ RSpec.describe "bundle install with explicit source paths" do end install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "foo", :path => "#{lib_path("foo-1.0")}" G @@ -476,6 +499,7 @@ RSpec.describe "bundle install with explicit source paths" do build_lib "bar", "1.0", :path => lib_path("foo/bar") install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "foo", :path => "#{lib_path("foo")}" G end @@ -720,6 +744,7 @@ RSpec.describe "bundle install with explicit source paths" do it "runs pre-install hooks" do build_git "foo" gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "foo", :git => "#{lib_path("foo-1.0")}" G @@ -739,6 +764,7 @@ RSpec.describe "bundle install with explicit source paths" do it "runs post-install hooks" do build_git "foo" gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "foo", :git => "#{lib_path("foo-1.0")}" G @@ -758,6 +784,7 @@ RSpec.describe "bundle install with explicit source paths" do it "complains if the install hook fails" do build_git "foo" gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "foo", :git => "#{lib_path("foo-1.0")}" G @@ -788,6 +815,7 @@ RSpec.describe "bundle install with explicit source paths" do end install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "foo", :path => "#{lib_path("foo-1.0")}" gem "bar", :path => "#{lib_path("bar-1.0")}" G |