-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added @marcandre case for rubygems/bundler#4934
Case will fail against 1.13.0, bug fix in rubygems/bundler#4977.
- Loading branch information
Showing
1 changed file
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# by @marcandre | ||
# | ||
# chrismo: to best leave existing behavior alone, there's no difference at all between | ||
# `bundle update` and `bundle update --major` - and so the whole new code path for doing the `--patch` | ||
# and `--minor` handling is completely skipped when `--major` is provided. Obviously, this is | ||
# the source of the inconsistency. I think with some work on a --conservative flag, we can get some | ||
# better stuff. | ||
BundlerCase.define do | ||
setup = step 'Setup Gemfile' do | ||
given_gems do | ||
fake_gem 'foo', '1.4.3', [['bar', '~> 2.0']] | ||
fake_gem 'foo', '1.4.4', [['bar', '~> 2.0']] | ||
fake_gem 'bar', %w(2.0.3 2.0.4) | ||
end | ||
|
||
given_bundler_version { '1.13.0' } | ||
|
||
given_gemfile lock: ['foo 1.4.3', 'bar 2.0.3'] do | ||
<<-G | ||
source 'fake' do | ||
gem 'foo' | ||
end | ||
G | ||
end | ||
|
||
expect_locked { ['foo 1.4.3', 'bar 2.0.3'] } | ||
end | ||
|
||
step do | ||
execute_bundler { 'bundle update' } | ||
expect_locked { ['foo 1.4.4', 'bar 2.0.4'] } | ||
end | ||
|
||
repeat_step setup | ||
|
||
step do | ||
execute_bundler { 'bundle update foo' } | ||
expect_locked { ['foo 1.4.4', 'bar 2.0.4'] } | ||
end | ||
|
||
repeat_step setup | ||
|
||
step "major" do | ||
execute_bundler { 'bundle update --major foo' } | ||
expect_locked { ['foo 1.4.4', 'bar 2.0.4'] } | ||
end | ||
|
||
repeat_step setup | ||
|
||
# Specifying --minor behaves differently than --major, even though | ||
# the only available version available are patch releases. | ||
# Inconsistent, probably a bug | ||
step "minor" do | ||
execute_bundler { 'bundle update --minor foo' } | ||
expect_locked { ['foo 1.4.4', 'bar 2.0.4'] } | ||
end | ||
|
||
repeat_step setup | ||
|
||
# Specifying --patch behaves differently than --major, even though | ||
# the only available version available are patch releases. | ||
# Inconsistent, probably a bug | ||
step "patch" do | ||
execute_bundler { 'bundle update --patch foo' } | ||
expect_locked { ['foo 1.4.4', 'bar 2.0.4'] } | ||
end | ||
end |