summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2018-01-08 09:53:28 -0800
committerGitHub <noreply@github.com>2018-01-08 09:53:28 -0800
commit6d6b3390ec2f5db4d527b4a7b0d0123a959a5204 (patch)
tree4b4c57f377d9093b0b9ed79fe4aca50db11d3565
parentd4d5de35d4e05a2c7d68c973d8f7ef4a1748e813 (diff)
parentdfc85c82105d2c7a5b03cf8cf60ba9e0a8fe51f9 (diff)
downloadchef-6d6b3390ec2f5db4d527b4a7b0d0123a959a5204.tar.gz
Merge pull request #6732 from chef/deprecations
Enable the deprecation for use_inline_resource
-rw-r--r--lib/chef/provider.rb10
-rw-r--r--spec/unit/provider_spec.rb1
2 files changed, 8 insertions, 3 deletions
diff --git a/lib/chef/provider.rb b/lib/chef/provider.rb
index 9e9013b24e..874735e048 100644
--- a/lib/chef/provider.rb
+++ b/lib/chef/provider.rb
@@ -71,10 +71,10 @@ class Chef
# Deprecation stub for the old use_inline_resources mode.
#
+ # @deprecated
# @return [void]
def self.use_inline_resources
- # Uncomment this in Chef 13.6.
- # Chef.deprecated(:use_inline_resources, "The use_inline_resources mode is no longer optional and the line enabling it can be removed")
+ Chef.deprecated(:use_inline_resources, "The use_inline_resources mode is no longer optional and the line enabling it can be removed")
end
#--
@@ -96,10 +96,14 @@ class Chef
self.class.include_resource_dsl_module(new_resource)
end
+ # are we currently running in why-run mode?
+ # @return [Boolean]
def whyrun_mode?
Chef::Config[:why_run]
end
+ # is why run mode supported by the provider? We assume yes by default since 13.0
+ # @return [Boolean]
def whyrun_supported?
true
end
@@ -113,6 +117,8 @@ class Chef
run_context && run_context.resource_collection
end
+ # the name of the current cookbook
+ # @return [String]
def cookbook_name
new_resource.cookbook_name
end
diff --git a/spec/unit/provider_spec.rb b/spec/unit/provider_spec.rb
index 6eb2bb9303..613f03a883 100644
--- a/spec/unit/provider_spec.rb
+++ b/spec/unit/provider_spec.rb
@@ -197,7 +197,6 @@ describe Chef::Provider do
context "when using use_inline_resources" do
it "should log a deprecation warning" do
- pending Chef::VERSION.start_with?("13.6")
expect(Chef).to receive(:deprecated).with(:use_inline_resources, kind_of(String))
Class.new(described_class) { use_inline_resources }
end