summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2015-02-09 14:48:16 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2015-02-09 14:48:16 -0800
commit6c45ef91d4e5bea527da8bb87451069c9c21599f (patch)
treee49c910d8816bc442d02c910c8682535eb7f71c8
parent11140c2cbd6f675c1bc0c3f5697f23d6404886ba (diff)
downloadchef-lcg/chef-gem-config-option.tar.gz
patch chef_gem to use Chef::Log.deprecationlcg/chef-gem-config-option
-rw-r--r--lib/chef/application.rb2
-rw-r--r--lib/chef/resource/chef_gem.rb6
-rw-r--r--spec/unit/resource/chef_gem_spec.rb12
3 files changed, 10 insertions, 10 deletions
diff --git a/lib/chef/application.rb b/lib/chef/application.rb
index 00992fdec1..6c85f951f6 100644
--- a/lib/chef/application.rb
+++ b/lib/chef/application.rb
@@ -375,7 +375,7 @@ class Chef
def emit_warnings
if Chef::Config[:chef_gem_compile_time]
- Chef::Log.warn "setting chef_gem_compile_time to true is deprecated"
+ Chef::Log.deprecation "setting chef_gem_compile_time to true is deprecated"
end
end
diff --git a/lib/chef/resource/chef_gem.rb b/lib/chef/resource/chef_gem.rb
index c95bf03200..59f575a524 100644
--- a/lib/chef/resource/chef_gem.rb
+++ b/lib/chef/resource/chef_gem.rb
@@ -53,9 +53,9 @@ class Chef
# Chef::Resource.run_action: Caveat: this skips Chef::Runner.run_action, where notifications are handled
# Action could be an array of symbols, but probably won't (think install + enable for a package)
if compile_time.nil?
- Chef::Log.warn "#{self} chef_gem compile_time installation is deprecated"
- Chef::Log.warn "#{self} Please set `compile_time false` on the resource to use the new behavior."
- Chef::Log.warn "#{self} or set `compile_time true` on the resource if compile_time behavior is required."
+ Chef::Log.deprecation "#{self} chef_gem compile_time installation is deprecated"
+ Chef::Log.deprecation "#{self} Please set `compile_time false` on the resource to use the new behavior."
+ Chef::Log.deprecation "#{self} or set `compile_time true` on the resource if compile_time behavior is required."
end
if compile_time || compile_time.nil?
diff --git a/spec/unit/resource/chef_gem_spec.rb b/spec/unit/resource/chef_gem_spec.rb
index 18278ba336..7352a8f5fe 100644
--- a/spec/unit/resource/chef_gem_spec.rb
+++ b/spec/unit/resource/chef_gem_spec.rb
@@ -76,20 +76,20 @@ describe Chef::Resource::ChefGem, "gem_binary" do
it "runs the install at compile-time by default", :chef_lt_13_only do
expect(resource).to receive(:run_action).with(:install)
- expect(Chef::Log).to receive(:warn).at_least(:once)
+ expect(Chef::Log).to receive(:deprecation).at_least(:once)
recipe.chef_gem "foo"
end
# the default behavior will change in Chef-13
it "does not runs the install at compile-time by default", :chef_gte_13_only do
expect(resource).not_to receive(:run_action).with(:install)
- expect(Chef::Log).not_to receive(:warn)
+ expect(Chef::Log).not_to receive(:deprecation)
recipe.chef_gem "foo"
end
it "compile_time true installs at compile-time" do
expect(resource).to receive(:run_action).with(:install)
- expect(Chef::Log).not_to receive(:warn)
+ expect(Chef::Log).not_to receive(:deprecation)
recipe.chef_gem "foo" do
compile_time true
end
@@ -97,7 +97,7 @@ describe Chef::Resource::ChefGem, "gem_binary" do
it "compile_time false does not install at compile-time" do
expect(resource).not_to receive(:run_action).with(:install)
- expect(Chef::Log).not_to receive(:warn)
+ expect(Chef::Log).not_to receive(:deprecation)
recipe.chef_gem "foo" do
compile_time false
end
@@ -107,7 +107,7 @@ describe Chef::Resource::ChefGem, "gem_binary" do
let(:chef_gem_compile_time) { true }
before do
- expect(Chef::Log).not_to receive(:warn)
+ expect(Chef::Log).not_to receive(:deprecation)
end
it "by default installs at compile-time" do
@@ -135,7 +135,7 @@ describe Chef::Resource::ChefGem, "gem_binary" do
let(:chef_gem_compile_time) { false }
before do
- expect(Chef::Log).not_to receive(:warn)
+ expect(Chef::Log).not_to receive(:deprecation)
end
it "by default does not install at compile-time" do