diff options
| author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2024-09-20 20:01:13 +0200 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2024-09-24 14:17:23 +0000 |
| commit | b48add3c65c394b2314eb699441f1a1c27b3c2c0 (patch) | |
| tree | eedb451644c247f3cca5caf7608d5c6284c76fde /spec | |
| parent | 07842491c539bf5d0abe29d63380ee5aaf121934 (diff) | |
[rubygems/rubygems] Fix `bundler/inline` overwriting lockfiles
This was introduced by https://github.com/rubygems/rubygems/commit/0b7be7bb7705, because
the original patch was not adapted to some recent refactorings.
https://github.com/rubygems/rubygems/commit/0bca60d6e5
Co-authored-by: Hiroshi SHIBATA <hsbt@ruby-lang.org>
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/bundler/runtime/inline_spec.rb | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/spec/bundler/runtime/inline_spec.rb b/spec/bundler/runtime/inline_spec.rb index 2deda75509..5ff555ab0d 100644 --- a/spec/bundler/runtime/inline_spec.rb +++ b/spec/bundler/runtime/inline_spec.rb @@ -656,6 +656,20 @@ RSpec.describe "bundler/inline#gemfile" do expect(out).to include("after: [\"Test_Variable\"]") end + it "does not create a lockfile" do + script <<-RUBY + require 'bundler/inline' + + gemfile do + source "https://gem.repo1" + end + + puts Dir.glob("Gemfile.lock") + RUBY + + expect(out).to be_empty + end + it "does not load specified version of psych and stringio", :ruby_repo do build_repo4 do build_gem "psych", "999" @@ -678,4 +692,25 @@ RSpec.describe "bundler/inline#gemfile" do expect(out).to include("The psych gem was resolved to 999") expect(out).to include("The stringio gem was resolved to 999") end + + it "leaves a lockfile in the same directory as the inline script alone" do + install_gemfile <<~G + source "https://gem.repo1" + gem "foo" + G + + original_lockfile = lockfile + + script <<-RUBY, env: { "BUNDLER_SPEC_GEM_REPO" => gem_repo1.to_s } + require "bundler/inline" + + gemfile(true) do + source "https://gem.repo1" + + gem "myrack" + end + RUBY + + expect(lockfile).to eq(original_lockfile) + end end |
