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/cache | |
parent | b500e8fab445d5a4ad91fd71e622aff88d0c7dd6 (diff) | |
download | ruby-2f9e0cf1819b8679abe79494f622e1a42d7e021d.tar.gz |
[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/cache')
-rw-r--r-- | spec/bundler/cache/gems_spec.rb | 8 | ||||
-rw-r--r-- | spec/bundler/cache/git_spec.rb | 9 | ||||
-rw-r--r-- | spec/bundler/cache/path_spec.rb | 12 |
3 files changed, 28 insertions, 1 deletions
diff --git a/spec/bundler/cache/gems_spec.rb b/spec/bundler/cache/gems_spec.rb index 161ec64218..72e372fb41 100644 --- a/spec/bundler/cache/gems_spec.rb +++ b/spec/bundler/cache/gems_spec.rb @@ -4,6 +4,7 @@ RSpec.describe "bundle cache" do shared_examples_for "when there are only gemsources" do before :each do gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem 'rack' G @@ -39,6 +40,7 @@ RSpec.describe "bundle cache" do end install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "rack" G @@ -49,6 +51,7 @@ RSpec.describe "bundle cache" do system_gems "rack-1.0.0", :path => default_bundle_path gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "rack" G @@ -64,6 +67,7 @@ RSpec.describe "bundle cache" do cache_gems "rack-1.0.0" gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "rack" G @@ -100,7 +104,7 @@ RSpec.describe "bundle cache" do it "uses builtin gems when installing to system gems" do bundle "config set path.system true" - install_gemfile %(gem 'builtin_gem', '1.0.2') + install_gemfile %(source "#{file_uri_for(gem_repo1)}"; gem 'builtin_gem', '1.0.2') expect(the_bundle).to include_gems("builtin_gem 1.0.2") end @@ -134,6 +138,7 @@ RSpec.describe "bundle cache" do bundle "config set path.system true" install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem 'builtin_gem', '1.0.2' G @@ -302,6 +307,7 @@ RSpec.describe "bundle cache" do :path => bundled_app("vendor/cache") install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "foo-bundler" G diff --git a/spec/bundler/cache/git_spec.rb b/spec/bundler/cache/git_spec.rb index 25f12a9e87..b88993e9b1 100644 --- a/spec/bundler/cache/git_spec.rb +++ b/spec/bundler/cache/git_spec.rb @@ -18,6 +18,7 @@ RSpec.describe "bundle cache with git" do ref = git.ref_for("master", 11) install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "foo", :git => '#{lib_path("foo-1.0")}' G @@ -36,6 +37,7 @@ RSpec.describe "bundle cache with git" do ref = git.ref_for("master", 11) install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "foo", :git => '#{lib_path("foo-1.0")}' G @@ -55,6 +57,7 @@ RSpec.describe "bundle cache with git" do build_git "foo" install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "foo", :git => '#{lib_path("foo-1.0")}' G @@ -72,6 +75,7 @@ RSpec.describe "bundle cache with git" do old_ref = git.ref_for("master", 11) install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "foo", :git => '#{lib_path("foo-1.0")}' G @@ -102,6 +106,7 @@ RSpec.describe "bundle cache with git" do old_ref = git.ref_for("master", 11) install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "foo", :git => '#{lib_path("foo-1.0")}' G @@ -130,6 +135,7 @@ RSpec.describe "bundle cache with git" do ref = git.ref_for("master", 11) gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "foo", :git => '#{lib_path("foo-invalid")}', :branch => :master G @@ -160,6 +166,7 @@ RSpec.describe "bundle cache with git" do sys_exec "git commit -m \"submodulator\"", :dir => lib_path("has_submodule-1.0") install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" git "#{lib_path("has_submodule-1.0")}", :submodules => true do gem "has_submodule" end @@ -183,6 +190,7 @@ RSpec.describe "bundle cache with git" do update_git("foo") {|s| s.write "foo.gemspec", spec_lines.join("\n") } install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "foo", :git => '#{lib_path("foo-1.0")}' G bundle "config set cache_all true" @@ -197,6 +205,7 @@ RSpec.describe "bundle cache with git" do build_git "foo" gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "foo", :git => '#{lib_path("foo-1.0")}' G bundle "config set cache_all true" diff --git a/spec/bundler/cache/path_spec.rb b/spec/bundler/cache/path_spec.rb index c81dda7405..2ad136a008 100644 --- a/spec/bundler/cache/path_spec.rb +++ b/spec/bundler/cache/path_spec.rb @@ -5,6 +5,7 @@ RSpec.describe "bundle cache with path" do build_lib "foo", :path => bundled_app("lib/foo") install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "foo", :path => '#{bundled_app("lib/foo")}' G @@ -18,6 +19,7 @@ RSpec.describe "bundle cache with path" do build_lib "foo" install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "foo", :path => '#{lib_path("foo-1.0")}' G @@ -36,6 +38,7 @@ RSpec.describe "bundle cache with path" do build_lib libname, :path => libpath install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "#{libname}", :path => '#{libpath}' G @@ -51,6 +54,7 @@ RSpec.describe "bundle cache with path" do build_lib "foo" install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "foo", :path => '#{lib_path("foo-1.0")}' G @@ -73,6 +77,7 @@ RSpec.describe "bundle cache with path" do build_lib "foo" install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "foo", :path => '#{lib_path("foo-1.0")}' G @@ -84,6 +89,7 @@ RSpec.describe "bundle cache with path" do build_lib "bar" install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "bar", :path => '#{lib_path("bar-1.0")}' G @@ -95,6 +101,7 @@ RSpec.describe "bundle cache with path" do build_lib "foo" install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "foo", :path => '#{lib_path("foo-1.0")}' G @@ -107,6 +114,7 @@ RSpec.describe "bundle cache with path" do build_lib "foo" install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "foo", :path => '#{lib_path("foo-1.0")}' G @@ -119,6 +127,7 @@ RSpec.describe "bundle cache with path" do build_lib "foo" install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "foo", :path => '#{lib_path("foo-1.0")}' G @@ -127,6 +136,7 @@ RSpec.describe "bundle cache with path" do build_lib "bar" 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 @@ -139,6 +149,7 @@ RSpec.describe "bundle cache with path" do build_lib "foo" install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "foo", :path => '#{lib_path("foo-1.0")}' G @@ -147,6 +158,7 @@ RSpec.describe "bundle cache with path" do build_lib "baz" gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "foo", :path => '#{lib_path("foo-1.0")}' gem "baz", :path => '#{lib_path("baz-1.0")}' G |