diff options
author | Homu <homu@barosl.com> | 2016-04-18 07:31:47 +0900 |
---|---|---|
committer | Homu <homu@barosl.com> | 2016-04-18 07:31:47 +0900 |
commit | 0446fa9860f36a3ee75fa12599e03fabc613a894 (patch) | |
tree | 4c39eb26caaee241b188e73ef58d7bfee9fda0fe /spec | |
parent | f401c17292c67b94b0f15a8c40af528fbb243f37 (diff) | |
parent | 4d2e7117f3136003256baf49d95001e7e784c078 (diff) | |
download | bundler-0446fa9860f36a3ee75fa12599e03fabc613a894.tar.gz |
Auto merge of #4410 - bundler:seg-settings-load-config-tests, r=segiddins
Improve loading config files
Closes #4370.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/bundler/settings_spec.rb | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/spec/bundler/settings_spec.rb b/spec/bundler/settings_spec.rb index 239f5e6ade..a4ac02c0fb 100644 --- a/spec/bundler/settings_spec.rb +++ b/spec/bundler/settings_spec.rb @@ -16,6 +16,43 @@ describe Bundler::Settings do end end + describe "load_config" do + let(:hash) do + { + "build.thrift" => "--with-cppflags=-D_FORTIFY_SOURCE=0", + "build.libv8" => "--with-system-v8", + "build.therubyracer" => "--with-v8-dir", + "build.pg" => "--with-pg-config=/usr/local/Cellar/postgresql92/9.2.8_1/bin/pg_config", + "gem.coc" => "false", + "gem.mit" => "false", + "gem.test" => "minitest", + "thingy" => <<-EOS.tr("\n", " "), +--asdf --fdsa --ty=oh man i hope this doesnt break bundler because +that would suck --ehhh=oh geez it looks like i might have broken bundler somehow +--very-important-option=DontDeleteRoo +--very-important-option=DontDeleteRoo +--very-important-option=DontDeleteRoo +--very-important-option=DontDeleteRoo + EOS + "xyz" => "zyx", + } + end + + before do + hash.each do |key, value| + settings[key] = value + end + end + + it "can load the config" do + loaded = settings.send(:load_config, bundled_app("config")) + expected = Hash[hash.map do |k, v| + [settings.send(:key_for, k), v.to_s] + end] + expect(loaded).to eq(expected) + end + end + describe "#[]" do context "when not set" do context "when default value present" do |