summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorThe Bundler Bot <bot@bundler.io>2017-06-23 06:04:42 +0000
committerThe Bundler Bot <bot@bundler.io>2017-06-23 06:04:42 +0000
commit1018408d64a7b42f4c901b22af7ce3f9a3558120 (patch)
treef9383a909fa9bf185c052c33e1876f5cdf70b935 /spec
parent1102ec1a06d5971fc3c870b1ed50de8f826c36e4 (diff)
parent2f7fe6af5b0e45c00717810008f6c91eeb241775 (diff)
downloadbundler-1018408d64a7b42f4c901b22af7ce3f9a3558120.tar.gz
Auto merge of #5809 - bundler:seg-config-converted-value, r=indirect
[Settings] Print pretty values for settings as their converted values, rather than strings ### What was the end-user problem that led to this PR? The problem was `bundle config` would print bool keys as strings (i.e. `true` was printed as `"true"`) ### Was was your diagnosis of the problem? My diagnosis was we needed to convert the values before formatting them ### What is your fix for the problem, implemented in this PR? My fix extracts the conversion method, and calls it in `pretty_values_for`
Diffstat (limited to 'spec')
-rw-r--r--spec/bundler/settings_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/bundler/settings_spec.rb b/spec/bundler/settings_spec.rb
index 1c66cd73af..1acd2a97b3 100644
--- a/spec/bundler/settings_spec.rb
+++ b/spec/bundler/settings_spec.rb
@@ -150,6 +150,16 @@ that would suck --ehhh=oh geez it looks like i might have broken bundler somehow
end
end
+ describe "#pretty_values_for" do
+ it "prints the converted value rather than the raw string" do
+ bool_key = described_class::BOOL_KEYS.first
+ settings[bool_key] = false
+ expect(subject.pretty_values_for(bool_key)).to eq [
+ "Set for your local app (#{bundled_app("config")}): false",
+ ]
+ end
+ end
+
describe "#mirror_for" do
let(:uri) { URI("https://rubygems.org/") }