diff options
author | Thom May <thom@may.lt> | 2016-01-21 11:14:49 +0000 |
---|---|---|
committer | Thom May <thom@may.lt> | 2016-01-21 11:14:49 +0000 |
commit | b2287acca8df58079205979ab2ba956d0e281fe5 (patch) | |
tree | 471e241d05effbe9d2b470588c1ff0f647952741 /spec/unit/rest_spec.rb | |
parent | 38e4b8ad4a1d701878595c7822636f3cbb7f7af9 (diff) | |
parent | 3458740dc59959e0eaa88543883756d041435d56 (diff) | |
download | chef-b2287acca8df58079205979ab2ba956d0e281fe5.tar.gz |
Merge pull request #4423 from chef/tm/rest_deprecation
Add deprecation warnings to Chef::REST and all json_creates
Diffstat (limited to 'spec/unit/rest_spec.rb')
-rw-r--r-- | spec/unit/rest_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/unit/rest_spec.rb b/spec/unit/rest_spec.rb index 8e6a3be79c..86572c7034 100644 --- a/spec/unit/rest_spec.rb +++ b/spec/unit/rest_spec.rb @@ -74,6 +74,7 @@ describe Chef::REST do before(:each) do Chef::Log.init(log_stringio) + Chef::Config[:treat_deprecation_warnings_as_errors] = false end it "should have content length validation middleware after compressor middleware" do @@ -92,6 +93,12 @@ describe Chef::REST do Chef::REST.new(base_url, nil, nil, options) end + it "emits a deprecation warning" do + Chef::Config[:treat_deprecation_warnings_as_errors] = true + expect { Chef::REST.new(base_url) }.to raise_error Chef::Exceptions::DeprecatedFeatureError, + /Chef::REST is deprecated. Please use Chef::ServerAPI, or investigate Ridley or ChefAPI./ + end + context "when created with a chef zero URL" do let(:url) { "chefzero://localhost:1" } |