diff options
author | Fletcher Nichol <fnichol@nichol.ca> | 2012-11-08 11:17:35 -0700 |
---|---|---|
committer | Bryan McLellan <btm@opscode.com> | 2012-11-20 12:48:19 -0800 |
commit | 46f58b13432085f28ca2aaadaed5ab54b5d536ae (patch) | |
tree | 3593275e2265af48870b3ec455424d0e32eccbed | |
parent | 8dc20721f1c4afc3e8434516d1ebf3bc0d9264d9 (diff) | |
download | chef-46f58b13432085f28ca2aaadaed5ab54b5d536ae.tar.gz |
[CHEF-3597] Handle frozen strings in knife.rb chef_server_url var.
-rw-r--r-- | chef/lib/chef/config.rb | 2 | ||||
-rw-r--r-- | chef/spec/unit/config_spec.rb | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/chef/lib/chef/config.rb b/chef/lib/chef/config.rb index 6817ab008a..702aa04a9e 100644 --- a/chef/lib/chef/config.rb +++ b/chef/lib/chef/config.rb @@ -67,7 +67,7 @@ class Chef # url<String>:: String to be set for all of the chef-server-api URL's # config_attr_writer :chef_server_url do |url| - url.strip! + url = url.strip configure do |c| [ :registration_url, :template_url, diff --git a/chef/spec/unit/config_spec.rb b/chef/spec/unit/config_spec.rb index 89161c9df1..f26b7a39eb 100644 --- a/chef/spec/unit/config_spec.rb +++ b/chef/spec/unit/config_spec.rb @@ -62,6 +62,14 @@ describe Chef::Config do it_behaves_like "server URL" end + context "when the url is a frozen string" do + before do + Chef::Config.chef_server_url = " https://junglist.gen.nz".freeze + end + + it_behaves_like "server URL" + end + describe "class method: manage_secret_key" do before do Chef::FileCache.stub!(:load).and_return(true) |