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/runtime/setup_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/runtime/setup_spec.rb')
-rw-r--r-- | spec/bundler/runtime/setup_spec.rb | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/spec/bundler/runtime/setup_spec.rb b/spec/bundler/runtime/setup_spec.rb index e5662cc9ad..42bbacea0e 100644 --- a/spec/bundler/runtime/setup_spec.rb +++ b/spec/bundler/runtime/setup_spec.rb @@ -430,6 +430,7 @@ RSpec.describe "Bundler.setup" do build_git "rack", "1.0.0" gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "rack", :git => "#{lib_path("rack-1.0.0")}" G end @@ -857,7 +858,7 @@ end end it "should not remove itself from the LOAD_PATH and require a different copy of 'bundler/setup'" do - install_gemfile "" + install_gemfile "source \"#{file_uri_for(gem_repo1)}\"" ruby <<-R, :env => { "GEM_PATH" => symlinked_gem_home } TracePoint.trace(:class) do |tp| @@ -906,6 +907,7 @@ end FileUtils.rm(File.join(path, "foo.gemspec")) install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem 'foo', '1.2.3', :path => 'vendor/foo' G @@ -926,6 +928,7 @@ end FileUtils.rm(File.join(absolute_path, "foo.gemspec")) gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem 'foo', '1.2.3', :path => '#{relative_path}' G @@ -944,6 +947,7 @@ end build_git "no_gemspec", :gemspec => false install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "no_gemspec", "1.0", :git => "#{lib_path("no_gemspec-1.0")}" G end @@ -1046,6 +1050,7 @@ end end gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "bar", :git => "#{lib_path("bar-1.0")}" G end @@ -1092,6 +1097,7 @@ end describe "when Bundler is bundled" do it "doesn't blow up" do install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" gem "bundler", :path => "#{root}" G @@ -1223,7 +1229,7 @@ end describe "with gemified standard libraries" do it "does not load Psych" do - gemfile "" + gemfile "source \"#{file_uri_for(gem_repo1)}\"" ruby <<-RUBY require '#{entrypoint}/setup' puts defined?(Psych::VERSION) ? Psych::VERSION : "undefined" @@ -1236,7 +1242,7 @@ end end it "does not load openssl" do - install_gemfile "" + install_gemfile "source \"#{file_uri_for(gem_repo1)}\"" ruby <<-RUBY require "bundler/setup" puts defined?(OpenSSL) || "undefined" @@ -1295,13 +1301,13 @@ end RUBY it "activates no gems with -rbundler/setup" do - install_gemfile "" + install_gemfile "source \"#{file_uri_for(gem_repo1)}\"" ruby code, :env => { "RUBYOPT" => activation_warning_hack_rubyopt + " -rbundler/setup" } expect(out).to eq("{}") end it "activates no gems with bundle exec" do - install_gemfile "" + install_gemfile "source \"#{file_uri_for(gem_repo1)}\"" create_file("script.rb", code) bundle "exec ruby ./script.rb", :env => { "RUBYOPT" => activation_warning_hack_rubyopt } expect(out).to eq("{}") @@ -1310,7 +1316,7 @@ end it "activates no gems with bundle exec that is loaded" do skip "not executable" if Gem.win_platform? - install_gemfile "" + install_gemfile "source \"#{file_uri_for(gem_repo1)}\"" create_file("script.rb", "#!/usr/bin/env ruby\n\n#{code}") FileUtils.chmod(0o777, bundled_app("script.rb")) bundle "exec ./script.rb", :artifice => nil, :env => { "RUBYOPT" => activation_warning_hack_rubyopt } |