Skip to content

Commit 31f3b0d

Browse files
segiddinsdeivid-rodriguez
authored andcommitted
Merge pull request #6924 from rubygems/segiddins/bundle-update-redownload
Fix bundle update --redownload (cherry picked from commit c44fe8e)
1 parent 10639fb commit 31f3b0d

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

bundler/lib/bundler/cli/update.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def run
6363
opts = options.dup
6464
opts["update"] = true
6565
opts["local"] = options[:local]
66+
opts["force"] = options[:redownload]
6667

6768
Bundler.settings.set_command_option_if_given :jobs, opts["jobs"]
6869

bundler/spec/update/redownload_spec.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,15 @@
3030
bundle "update rack --no-color --redownload"
3131
expect(err).not_to include "[DEPRECATED] The `--force` option has been renamed to `--redownload`"
3232
end
33+
34+
it "re-installs installed gems" do
35+
rack_lib = default_bundle_path("gems/rack-1.0.0/lib/rack.rb")
36+
rack_lib.open("w") {|f| f.write("blah blah blah") }
37+
bundle :update, :redownload => true
38+
39+
expect(out).to include "Installing rack 1.0.0"
40+
expect(rack_lib.open(&:read)).to eq("RACK = '1.0.0'\n")
41+
expect(the_bundle).to include_gems "rack 1.0.0"
42+
end
3343
end
3444
end

0 commit comments

Comments
 (0)