summaryrefslogtreecommitdiff
path: root/spec/unit/deprecation_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/deprecation_spec.rb')
-rw-r--r--spec/unit/deprecation_spec.rb23
1 files changed, 1 insertions, 22 deletions
diff --git a/spec/unit/deprecation_spec.rb b/spec/unit/deprecation_spec.rb
index af8e34850b..6e2bcc32fd 100644
--- a/spec/unit/deprecation_spec.rb
+++ b/spec/unit/deprecation_spec.rb
@@ -45,35 +45,14 @@ describe Chef::Deprecation do
add_deprecation_warnings_for(DeprecatedMethods.instance_methods)
end
- method_snapshot_file = File.join(CHEF_SPEC_DATA, "file-providers-method-snapshot-chef-11-4.json")
- method_snapshot = Chef::JSONCompat.parse(File.open(method_snapshot_file).read())
-
- method_snapshot.each do |class_name, old_methods|
- class_object = class_from_string(class_name)
- current_methods = class_object.public_instance_methods.map(&:to_sym)
-
- it "defines all methods on #{class_object} that were available in 11.0" do
- old_methods.each do |old_method|
- expect(current_methods).to include(old_method.to_sym)
- end
- end
- end
-
context "when Chef::Config[:treat_deprecation_warnings_as_errors] is off" do
before do
Chef::Config[:treat_deprecation_warnings_as_errors] = false
end
context "deprecation warning messages" do
- RSpec::Matchers.define_negated_matcher :a_non_empty_array, :be_empty
-
it "should be enabled for deprecated methods" do
- expect(Chef::Log).to receive(:warn).with(a_non_empty_array)
- TestClass.new.deprecated_method(10)
- end
-
- it "should contain stack trace" do
- expect(Chef::Log).to receive(:warn).with(a_string_including(".rb"))
+ expect(Chef).to receive(:deprecated).with(:internal_api, /Method.*of 'TestClass'/)
TestClass.new.deprecated_method(10)
end
end