diff options
author | The Bundler Bot <bot@bundler.io> | 2017-06-23 06:04:42 +0000 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2017-07-17 12:03:17 -0500 |
commit | 1cea11a47c95fd69ff109f6bfa60148279f7d725 (patch) | |
tree | 1e1b2d8064aacc5da833f3010180c16ba02cf728 /spec/bundler | |
parent | 825b06819831613a33d55ecdf819cc8935243002 (diff) | |
download | bundler-1cea11a47c95fd69ff109f6bfa60148279f7d725.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`
(cherry picked from commit 1018408d64a7b42f4c901b22af7ce3f9a3558120)
Diffstat (limited to 'spec/bundler')
-rw-r--r-- | spec/bundler/settings_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/bundler/settings_spec.rb b/spec/bundler/settings_spec.rb index 020897882c..7302da5421 100644 --- a/spec/bundler/settings_spec.rb +++ b/spec/bundler/settings_spec.rb @@ -151,6 +151,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/") } |