diff options
| author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2025-08-27 19:48:39 +0200 |
|---|---|---|
| committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2025-09-03 23:38:37 +0900 |
| commit | 7488b48a76af7359ea121f42db12b12d6b439b0d (patch) | |
| tree | 0b30b2ffed85af436169b2d1f9c81cdce24cdb48 | |
| parent | 2052dd1cfc2f8241b89ae017ba60a096989a7be8 (diff) | |
[rubygems/rubygems] Improve spec wording and implementation
Limit the `before` block to set `frozen`, which is the context of the
spec, and change the implementation to only write the Gemfile once, with
a gem being removed from what's in the lockfile.
https://github.com/rubygems/rubygems/commit/4d0314ff37
| -rw-r--r-- | spec/bundler/commands/cache_spec.rb | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/spec/bundler/commands/cache_spec.rb b/spec/bundler/commands/cache_spec.rb index 973cf5add5..db5ec9cf21 100644 --- a/spec/bundler/commands/cache_spec.rb +++ b/spec/bundler/commands/cache_spec.rb @@ -292,6 +292,10 @@ RSpec.describe "bundle cache" do context "with frozen configured" do before do + bundle "config set --local frozen true" + end + + it "tries to install but fails when the lockfile is out of sync" do gemfile <<-G source "https://gem.repo1" gem "myrack" @@ -301,29 +305,23 @@ RSpec.describe "bundle cache" do remote: https://gem.repo1/ specs: myrack (1.0.0) + myrack-obama (1.0) + myrack PLATFORMS #{lockfile_platforms} DEPENDENCIES myrack + myrack-obama BUNDLED WITH #{Bundler::VERSION} L - bundle "config set --local frozen true" - end - - it "tries to install with frozen" do - gemfile <<-G - source "https://gem.repo1" - gem "myrack" - gem "myrack-obama" - G bundle :cache, raise_on_error: false expect(exitstatus).to eq(16) expect(err).to include("frozen mode") - expect(err).to include("You have added to the Gemfile") + expect(err).to include("You have deleted from the Gemfile") expect(err).to include("* myrack-obama") bundle "env" expect(out).to include("frozen") |
