summaryrefslogtreecommitdiff
path: root/spec/bundler/commands
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2022-08-19 20:35:26 +0200
committergit <svn-admin@ruby-lang.org>2022-08-21 17:53:40 +0900
commitb87ddd7538220e9782274281356fd55bfd29078b (patch)
tree5fa158c90d72ca4365d2cac4f5eeb320324300bd /spec/bundler/commands
parentf6d4d73abd986fbd89918fa8bbbb82746ee08371 (diff)
[rubygems/rubygems] Fix `bundle platform` crash when there's a lockfile with no Ruby locked
https://github.com/rubygems/rubygems/commit/49fc54e87d
Diffstat (limited to 'spec/bundler/commands')
-rw-r--r--spec/bundler/commands/platform_spec.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/bundler/commands/platform_spec.rb b/spec/bundler/commands/platform_spec.rb
index 0b964eac8c..4e8e3946fe 100644
--- a/spec/bundler/commands/platform_spec.rb
+++ b/spec/bundler/commands/platform_spec.rb
@@ -234,6 +234,29 @@ G
expect(out).to eq("ruby 1.0.0")
end
+ it "handles when there is a lockfile with no requirement" do
+ gemfile <<-G
+ source "#{file_uri_for(gem_repo1)}"
+ G
+
+ lockfile <<-L
+ GEM
+ remote: #{file_uri_for(gem_repo1)}/
+ specs:
+
+ PLATFORMS
+ ruby
+
+ DEPENDENCIES
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ L
+
+ bundle "platform --ruby"
+ expect(out).to eq("No ruby version specified")
+ end
+
it "handles when there is a requirement in the gemfile" do
gemfile <<-G
source "#{file_uri_for(gem_repo1)}"