summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorMichael Siegfried <michael@procore.com>2022-01-04 14:54:17 -0800
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2022-12-20 13:15:02 +0900
commit2bc4f1dea5e663acba1d3c662390e8fc20bf6721 (patch)
tree1269485972bc55f03289e58a2a9276947e61b127 /spec
parent1ee31f9d9dc8da4b0eb8ca39b79a6b270c6c2f2d (diff)
[rubygems/rubygems] Support for pre flag in `bundle update`
Passing this flag allows bumping to the current version, even if that version is prerelease. This works in concert with the current flags. https://github.com/rubygems/rubygems/commit/a6409e3509
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/6966
Diffstat (limited to 'spec')
-rw-r--r--spec/bundler/commands/update_spec.rb31
1 files changed, 30 insertions, 1 deletions
diff --git a/spec/bundler/commands/update_spec.rb b/spec/bundler/commands/update_spec.rb
index 1ad5f76466..2d9da70617 100644
--- a/spec/bundler/commands/update_spec.rb
+++ b/spec/bundler/commands/update_spec.rb
@@ -1409,7 +1409,10 @@ RSpec.describe "bundle update conservative" do
build_gem "foo", %w[1.5.1] do |s|
s.add_dependency "bar", "~> 3.0"
end
- build_gem "bar", %w[2.0.3 2.0.4 2.0.5 2.1.0 2.1.1 3.0.0]
+ build_gem "foo", %w[2.0.0.pre] do |s|
+ s.add_dependency "bar"
+ end
+ build_gem "bar", %w[2.0.3 2.0.4 2.0.5 2.1.0 2.1.1 2.1.2.pre 3.0.0 3.1.0.pre 4.0.0.pre]
build_gem "qux", %w[1.0.0 1.0.1 1.1.0 2.0.0]
end
@@ -1474,6 +1477,32 @@ RSpec.describe "bundle update conservative" do
expect(the_bundle).to include_gems "foo 1.5.0", "bar 2.1.1", "qux 1.1.0"
end
end
+
+ context "pre" do
+ it "defaults to major" do
+ bundle "update --pre foo bar"
+
+ expect(the_bundle).to include_gems "foo 2.0.0.pre", "bar 4.0.0.pre", "qux 1.0.0"
+ end
+
+ it "patch preferred" do
+ bundle "update --patch --pre foo bar"
+
+ expect(the_bundle).to include_gems "foo 1.4.5", "bar 2.1.2.pre", "qux 1.0.0"
+ end
+
+ it "minor preferred" do
+ bundle "update --minor --pre foo bar"
+
+ expect(the_bundle).to include_gems "foo 1.5.1", "bar 3.1.0.pre", "qux 1.0.0"
+ end
+
+ it "major preferred" do
+ bundle "update --major --pre foo bar"
+
+ expect(the_bundle).to include_gems "foo 2.0.0.pre", "bar 4.0.0.pre", "qux 1.0.0"
+ end
+ end
end
context "eager unlocking" do