diff options
author | JuanitoFatas <katehuang0320@gmail.com> | 2016-08-28 16:18:22 +0800 |
---|---|---|
committer | JuanitoFatas <katehuang0320@gmail.com> | 2016-08-28 16:20:16 +0800 |
commit | 84d56f5bb2ff707f7c3b733f0d0d960031897c2d (patch) | |
tree | 9859fbde14af18a35c7575256a18f7d0a83b4fff /spec/commands/config_spec.rb | |
parent | 73fc9058bd2ee78e707e34cdc6f9ea62cbadcb14 (diff) | |
download | bundler-84d56f5bb2ff707f7c3b733f0d0d960031897c2d.tar.gz |
Add more test cases for bundle config --parseable option
Diffstat (limited to 'spec/commands/config_spec.rb')
-rw-r--r-- | spec/commands/config_spec.rb | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/spec/commands/config_spec.rb b/spec/commands/config_spec.rb index 040b04e57b..9ab36176f0 100644 --- a/spec/commands/config_spec.rb +++ b/spec/commands/config_spec.rb @@ -188,8 +188,32 @@ describe ".bundle/config" do end context "with --parseable option" do - it "returns value associated with the config" do - global_config "BUNDLE_GEM__COC" => "true" + it "returns empty when not set" do + bundle "config gem.coc", :parseable => true + + expect(out).to eq "" + end + + it "returns true when set" do + bundle "config gem.coc true" + + bundle "config gem.coc", :parseable => true + + expect(out).to eq "true" + end + + it "returns empty string when unset" do + bundle "config gem.coc true" + bundle "config --delete gem.coc" + + bundle "config gem.coc", :parseable => true + + expect(out).to eq "" + end + + it "returns default if global default presents when unset" do + bundle "config --delete gem.coc" + bundle "config --global gem.coc true" bundle "config gem.coc", :parseable => true |