summaryrefslogtreecommitdiff
path: root/spec/unit/rest_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/rest_spec.rb')
-rw-r--r--spec/unit/rest_spec.rb7
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" }