diff options
author | Tim Smith <tsmith@chef.io> | 2016-12-06 10:47:34 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-06 10:47:34 -0800 |
commit | 3ee4a7d966235eb7e941dad31e8aa2001154d816 (patch) | |
tree | f5baca868ed12c9d515594b926eded8ed8bd9cb1 | |
parent | 1692f51c330b1f47992289af9db548b1adf362d3 (diff) | |
parent | 638f5cc352d25334a7ee0f2a779abf5b3bfe00bd (diff) | |
download | chef-3ee4a7d966235eb7e941dad31e8aa2001154d816.tar.gz |
Merge pull request #5615 from chef/tas50/typo
The suggested fix for the manage_home deprecation is incorrect
-rw-r--r-- | lib/chef/resource/user.rb | 4 | ||||
-rw-r--r-- | spec/unit/provider/user/linux_spec.rb | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/lib/chef/resource/user.rb b/lib/chef/resource/user.rb index 19a4e2faf5..fc7720bc25 100644 --- a/lib/chef/resource/user.rb +++ b/lib/chef/resource/user.rb @@ -158,10 +158,10 @@ class Chef def supports(args = {}) if args.key?(:manage_home) - Chef.deprecated(:supports_property, "supports { manage_home: #{args[:manage_home]} } on the user resource is deprecated and will be removed in Chef 13, set manage_home: #{args[:manage_home]} instead") + Chef.deprecated(:supports_property, "supports { manage_home: #{args[:manage_home]} } on the user resource is deprecated and will be removed in Chef 13, set manage_home #{args[:manage_home]} instead") end if args.key?(:non_unique) - Chef.deprecated(:supports_property, "supports { non_unique: #{args[:non_unique]} } on the user resource is deprecated and will be removed in Chef 13, set non_unique: #{args[:non_unique]} instead") + Chef.deprecated(:supports_property, "supports { non_unique: #{args[:non_unique]} } on the user resource is deprecated and will be removed in Chef 13, set non_unique #{args[:non_unique]} instead") end super end diff --git a/spec/unit/provider/user/linux_spec.rb b/spec/unit/provider/user/linux_spec.rb index 819dc5e0fe..ce9b84ec92 100644 --- a/spec/unit/provider/user/linux_spec.rb +++ b/spec/unit/provider/user/linux_spec.rb @@ -67,9 +67,15 @@ describe Chef::Provider::User::Linux do expect( @new_resource.supports[:non_unique] ).to be false end + it "throws a deprecation warning on setting supports[:non_unique]" do + Chef::Config[:treat_deprecation_warnings_as_errors] = false + expect(Chef).to receive(:deprecated).with(:supports_property, "supports { non_unique: true } on the user resource is deprecated and will be removed in Chef 13, set non_unique true instead") + @new_resource.supports( { :non_unique => true } ) + end + it "throws a deprecation warning on setting supports[:manage_home]" do Chef::Config[:treat_deprecation_warnings_as_errors] = false - expect(Chef).to receive(:deprecated).with(:supports_property, "supports { manage_home: true } on the user resource is deprecated and will be removed in Chef 13, set manage_home: true instead") + expect(Chef).to receive(:deprecated).with(:supports_property, "supports { manage_home: true } on the user resource is deprecated and will be removed in Chef 13, set manage_home true instead") @new_resource.supports( { :manage_home => true } ) end |