diff options
author | Felipe Tanus <fotanus@gmail.com> | 2015-05-15 12:02:10 -0300 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2015-05-16 14:57:12 -0700 |
commit | 6506ac5419248a9426d9becd4d337375a9cd24f3 (patch) | |
tree | 7615bf9590c0c208aef6267d922a113bd8cbe011 | |
parent | 49c9784705aa23c12ab7731b89047a86a06fe163 (diff) | |
download | bundler-6506ac5419248a9426d9becd4d337375a9cd24f3.tar.gz |
#3649 - Stop printing replacement message when config is not changed
-rw-r--r-- | lib/bundler/cli/config.rb | 2 | ||||
-rw-r--r-- | spec/commands/config_spec.rb | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/bundler/cli/config.rb b/lib/bundler/cli/config.rb index cad67a571d..8d65e7c813 100644 --- a/lib/bundler/cli/config.rb +++ b/lib/bundler/cli/config.rb @@ -59,7 +59,7 @@ module Bundler "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 diff --git a/spec/commands/config_spec.rb b/spec/commands/config_spec.rb index 5a4213a666..dd62d11ab1 100644 --- a/spec/commands/config_spec.rb +++ b/spec/commands/config_spec.rb @@ -96,6 +96,15 @@ describe ".bundle/config" do 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']" |