summaryrefslogtreecommitdiff
path: root/spec/unit/provider
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-02-28 14:28:47 -0800
committerTim Smith <tsmith84@gmail.com>2020-02-28 15:01:03 -0800
commit24ba928939eee5dbcc6267dde60e664c8c44087d (patch)
tree0174069277b28a58b1fa973de1638a05128e3a61 /spec/unit/provider
parenta60b4aec184b97986dde9ed577b9558d10fea951 (diff)
downloadchef-24ba928939eee5dbcc6267dde60e664c8c44087d.tar.gz
directory resource: Remove support for macOS < 10.11
There's no reason to test this behavior anymore since we don't support macOS < 10.13 Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'spec/unit/provider')
-rw-r--r--spec/unit/provider/directory_spec.rb21
1 files changed, 5 insertions, 16 deletions
diff --git a/spec/unit/provider/directory_spec.rb b/spec/unit/provider/directory_spec.rb
index 4672db7d8d..995b35bfa0 100644
--- a/spec/unit/provider/directory_spec.rb
+++ b/spec/unit/provider/directory_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright 2008-2016, Chef Software Inc.
+# Copyright:: Copyright 2008-2020, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -201,33 +201,22 @@ describe Chef::Provider::Directory do
end
end
- describe "on OS X" do
+ describe "on macOS" do
before do
- allow(node).to receive(:[]).with("platform").and_return("mac_os_x")
+ allow(ChefUtils).to receive(:macos?).and_return(true)
new_resource.path "/usr/bin/chef_test"
new_resource.recursive false
allow_any_instance_of(Chef::Provider::File).to receive(:do_selinux)
end
- it "os x 10.10 can write to sip locations" do
- allow(node).to receive(:[]).with("platform_version").and_return("10.10")
- allow(Dir).to receive(:mkdir).and_return([true], [])
- allow(::File).to receive(:directory?).and_return(true)
- allow(Chef::FileAccessControl).to receive(:writable?).and_return(true)
- directory.run_action(:create)
- expect(new_resource).to be_updated
- end
-
- it "os x 10.11 cannot write to sip locations" do
- allow(node).to receive(:[]).with("platform_version").and_return("10.11")
+ it "macOS cannot write to sip locations" do
allow(::File).to receive(:directory?).and_return(true)
allow(Chef::FileAccessControl).to receive(:writable?).and_return(false)
expect { directory.run_action(:create) }.to raise_error(Chef::Exceptions::InsufficientPermissions)
end
- it "os x 10.11 can write to sip exlcusions" do
+ it "macOS can write to sip exclusions" do
new_resource.path "/usr/local/chef_test"
- allow(node).to receive(:[]).with("platform_version").and_return("10.11")
allow(::File).to receive(:directory?).and_return(true)
allow(Dir).to receive(:mkdir).and_return([true], [])
allow(Chef::FileAccessControl).to receive(:writable?).and_return(false)