Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
#3649 - Stop printing replacement message when config is not changed
Browse files Browse the repository at this point in the history
  • Loading branch information
fotanus authored and indirect committed May 16, 2015
1 parent 49c9784 commit 6506ac5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/bundler/cli/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def run
"This will take precedence over the global value you are setting"
end

if global = locations[:global]
if global = locations[:global] and global != locations[:global]
Bundler.ui.info "You are replacing the current global value of #{name}, which is currently #{global.inspect}"
end
end
Expand Down
9 changes: 9 additions & 0 deletions spec/commands/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,15 @@
expect(out).to eq("global")
end

it "do not warns when using the same value twice" do
bundle "config --global foo value"
bundle "config --global foo value"
expect(out).not_to match(/You are replacing the current global value of foo/)

run "puts Bundler.settings[:foo]"
expect(out).to eq("value")
end

it "expands the path at time of setting" do
bundle "config --global local.foo .."
run "puts Bundler.settings['local.foo']"
Expand Down

0 comments on commit 6506ac5

Please sign in to comment.