aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorStrech (Sergey Fedorov) <oni.strech@gmail.com>2015-05-14 14:02:14 +0500
committerAndre Arko <andre@arko.net>2015-05-16 14:40:18 -0700
commited86e50c8c7414c0a53f5288c5e4e7925b4960d5 (patch)
tree1b0be360183328c77112bfb1a27104d42eff3ad6 /spec
parent910529997449d91e94f1ce58dce59dc2212320e2 (diff)
downloadbundler-ed86e50c8c7414c0a53f5288c5e4e7925b4960d5.tar.gz
Added backward compatibility for BUNDLE_* config keys
Closes #3557
Diffstat (limited to 'spec')
-rw-r--r--spec/bundler/settings_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/bundler/settings_spec.rb b/spec/bundler/settings_spec.rb
index 56ee87da..a6c6d42e 100644
--- a/spec/bundler/settings_spec.rb
+++ b/spec/bundler/settings_spec.rb
@@ -48,6 +48,24 @@ describe Bundler::Settings do
settings["mirror.https://rubygems.org"] = "http://rubygems-mirror.org"
expect(settings.gem_mirrors).to eq(URI("https://rubygems.org/") => URI("http://rubygems-mirror.org/"))
end
+ end
+
+ describe "BUNDLE_ keys format" do
+ let(:settings) { described_class.new(bundled_app('.bundle')) }
+
+ it "converts older keys without double dashes" do
+ config("BUNDLE_MY__PERSONAL.RACK" => "~/Work/git/rack")
+ expect(settings["my.personal.rack"]).to eq("~/Work/git/rack")
+ end
+ it "converts older keys without trailing slashes and double dashes" do
+ config("BUNDLE_MIRROR__HTTPS://RUBYGEMS.ORG" => "http://rubygems-mirror.org")
+ expect(settings["mirror.https://rubygems.org/"]).to eq("http://rubygems-mirror.org")
+ end
+
+ it "reads newer keys format properly" do
+ config("BUNDLE_MIRROR__HTTPS://RUBYGEMS__ORG/" => "http://rubygems-mirror.org")
+ expect(settings["mirror.https://rubygems.org/"]).to eq("http://rubygems-mirror.org")
+ end
end
end