spec/unit/settings_spec.rb in r10k-2.1.0 vs spec/unit/settings_spec.rb in r10k-2.1.1
- old
+ new
@@ -1,7 +1,8 @@
require 'spec_helper'
require 'r10k/settings'
+require 'r10k/util/exec_env'
describe R10K::Settings do
describe "git settings" do
subject { described_class.git_settings }
@@ -48,9 +49,20 @@
}.to raise_error do |err|
expect(err.message).to match(/Validation failed for forge settings group/)
expect(err.errors.size).to eq 1
expect(err.errors[:proxy]).to be_a_kind_of(ArgumentError)
expect(err.errors[:proxy].message).to match(/could not be parsed as a URL/)
+ end
+ end
+
+ describe "setting a default value" do
+ %w[HTTPS_PROXY https_proxy HTTP_PROXY http_proxy].each do |env_var|
+ it "respects the #{env_var} environment variable" do
+ R10K::Util::ExecEnv.withenv(env_var => "http://proxy.value/#{env_var}") do
+ output = subject.evaluate({})
+ expect(output[:proxy]).to eq("http://proxy.value/#{env_var}")
+ end
+ end
end
end
end
describe "baseurl" do