summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2021-08-18 09:58:51 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-08-31 19:06:14 +0900
commit3683781f53cc22b9fa507e4a2848c30086fa7897 (patch)
tree82610caf483f7c852fb866bb2781bd516fe1fe14 /spec
parent71f6711351b89330f5445cef6f0a38618627ce66 (diff)
[rubygems/rubygems] Restore working `bundle check` behaviour
As part of a recent bug fix where bundler was accidentally hitting the network when not supposed to, I made some refactoring, and the commit I'm reverting here (https://github.com/rubygems/rubygems/commit/d74830d00bb541883377992f56818620a78930b0) was some cleanup that those refactorings allowed according to "past me". That was completely wrong, `bundle check` should never consider cached gems, only installed gems, so the code that was removed was necessary. https://github.com/rubygems/rubygems/commit/5483e98305
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4789
Diffstat (limited to 'spec')
-rw-r--r--spec/bundler/commands/check_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/bundler/commands/check_spec.rb b/spec/bundler/commands/check_spec.rb
index c48220f8df..7eb3fec2e5 100644
--- a/spec/bundler/commands/check_spec.rb
+++ b/spec/bundler/commands/check_spec.rb
@@ -137,6 +137,22 @@ RSpec.describe "bundle check" do
expect(exitstatus).to eq(1)
end
+ it "ensures that gems are actually installed and not just cached in applications' cache" do
+ gemfile <<-G
+ source "#{file_uri_for(gem_repo1)}"
+ gem "rack"
+ G
+
+ bundle "config set --local path vendor/bundle"
+ bundle :cache
+
+ gem_command "uninstall rack", :env => { "GEM_HOME" => vendored_gems.to_s }
+
+ bundle "check", :raise_on_error => false
+ expect(err).to include("* rack (1.0.0)")
+ expect(exitstatus).to eq(1)
+ end
+
it "ignores missing gems restricted to other platforms" do
gemfile <<-G
source "#{file_uri_for(gem_repo1)}"