diff options
author | Kartik Null Cating-Subramanian <ksubramanian@chef.io> | 2015-08-05 11:39:11 -0400 |
---|---|---|
committer | Kartik Null Cating-Subramanian <ksubramanian@chef.io> | 2015-08-06 11:05:16 -0400 |
commit | f3b3c3aeff0704ab96a8ca136a064d1077025739 (patch) | |
tree | c01ddda087e860483368f3f96584aacdc81615b7 | |
parent | 3cb1dd2b59a5c2a32db24287cb8bf43b6d3357e4 (diff) | |
download | chef-f3b3c3aeff0704ab96a8ca136a064d1077025739.tar.gz |
Fix expected exception on Mac in group_spec
-rw-r--r-- | spec/functional/resource/group_spec.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/spec/functional/resource/group_spec.rb b/spec/functional/resource/group_spec.rb index 19a4d25404..4909040ba5 100644 --- a/spec/functional/resource/group_spec.rb +++ b/spec/functional/resource/group_spec.rb @@ -205,9 +205,12 @@ describe Chef::Resource::Group, :requires_root_or_running_windows, :not_supporte end describe "when the users doesn't exist" do + let (:append_expected_exception) do + ohai[:platform_family] == "windows" ? Chef::Exceptions::Win32APIError : Mixlib::ShellOut::ShellCommandFailed + end describe "when append is not set" do it "should raise an error" do - expect { group_resource.run_action(tested_action) }.to raise_error(Chef::Exceptions::Win32APIError) + expect { group_resource.run_action(tested_action) }.to raise_error(append_expected_exception) end end @@ -216,7 +219,7 @@ describe Chef::Resource::Group, :requires_root_or_running_windows, :not_supporte group_resource.append(true) end it "should raise an error" do - expect { group_resource.run_action(tested_action) }.to raise_error(Chef::Exceptions::Win32APIError) + expect { group_resource.run_action(tested_action) }.to raise_error(append_expected_exception) end end end |