summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2016-03-28 17:47:47 -0500
committerSamuel Giddins <segiddins@segiddins.me>2016-03-28 17:47:47 -0500
commit9fe810a73672c2a2fe1b9bc0d6af2d49f479543d (patch)
treed9b00573384234db10c4b4bb83d382fa391a8646
parent4fe19816b28f0ddb0b933a8e9b102284fdb258fe (diff)
downloadbundler-9fe810a73672c2a2fe1b9bc0d6af2d49f479543d.tar.gz
[Settings] Add specs for #load_config
-rw-r--r--spec/bundler/settings_spec.rb37
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