From 982ec1a40fa7ad79337b2bd780d976b14d1de275 Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Thu, 15 Sep 2016 09:28:47 -0700 Subject: suppress deprecation errors in tests Signed-off-by: Lamont Granquist --- spec/unit/provider/user/dscl_spec.rb | 4 ++++ spec/unit/provider/user/pw_spec.rb | 2 ++ 2 files changed, 6 insertions(+) diff --git a/spec/unit/provider/user/dscl_spec.rb b/spec/unit/provider/user/dscl_spec.rb index dfaaa377d3..7b8be02f3a 100644 --- a/spec/unit/provider/user/dscl_spec.rb +++ b/spec/unit/provider/user/dscl_spec.rb @@ -219,6 +219,8 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30" end before do + Chef::Config[:treat_deprecation_warnings_as_errors] = false + Chef::Config[:treat_deprecation_warnings_as_errors] = false new_resource.supports({ :manage_home => true }) new_resource.home("/Users/toor") @@ -237,6 +239,7 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30" end it "moves the users home to the new location if it exists and the target location is different" do + Chef::Config[:treat_deprecation_warnings_as_errors] = false new_resource.supports(:manage_home => true) current_home = CHEF_SPEC_DATA + "/old_home_dir" @@ -856,6 +859,7 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30") describe "when Chef is removing the user" do it "removes the user from the groups and deletes home directory when the resource is configured to manage home" do + Chef::Config[:treat_deprecation_warnings_as_errors] = false new_resource.supports({ :manage_home => true }) expect(provider).to receive(:run_dscl).with("list /Groups").and_return("my_group\nyour_group\nreal_group\n") expect(provider).to receive(:run_dscl).with("read /Groups/my_group").and_raise(Chef::Exceptions::DsclCommandFailed) # Empty group diff --git a/spec/unit/provider/user/pw_spec.rb b/spec/unit/provider/user/pw_spec.rb index 624bcfc67d..fb7c9211a1 100644 --- a/spec/unit/provider/user/pw_spec.rb +++ b/spec/unit/provider/user/pw_spec.rb @@ -32,6 +32,8 @@ describe Chef::Provider::User::Pw do @new_resource.shell "/usr/bin/zsh" @new_resource.password "abracadabra" + # XXX: rip out in Chef-13 + Chef::Config[:treat_deprecation_warnings_as_errors] = false @new_resource.supports :manage_home => true @current_resource = Chef::Resource::User::PwUser.new("adam") -- cgit v1.2.1