diff options
author | Tim Smith <tsmith84@gmail.com> | 2020-08-18 16:28:19 -0700 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2020-08-18 16:28:19 -0700 |
commit | 292ee1cc5b92b4f13b6ebe62cb027e4e32654495 (patch) | |
tree | 8eb8c5854b2f15b7bb8128edba0a5fce9945edd4 | |
parent | 7471fc2d334e823b91851d09198cd5e5826bb283 (diff) | |
download | chef-292ee1cc5b92b4f13b6ebe62cb027e4e32654495.tar.gz |
Rename method to match others
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r-- | lib/chef/resource/timezone.rb | 4 | ||||
-rw-r--r-- | spec/unit/resource/timezone_spec.rb | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/chef/resource/timezone.rb b/lib/chef/resource/timezone.rb index 2be963cf55..04e5884b88 100644 --- a/lib/chef/resource/timezone.rb +++ b/lib/chef/resource/timezone.rb @@ -60,7 +60,7 @@ class Chef # # @since 14.7 # @return [String] TZ database value - def current_darwin_tz + def current_macos_tz tz_shellout = shell_out!(["systemsetup", "-gettimezone"]) if /You need administrator access/.match?(tz_shellout.stdout) raise "The timezone resource requires administrative privileges to run on macOS hosts!" @@ -112,7 +112,7 @@ class Chef when "rhel", "amazon" timezone current_rhel_tz when "mac_os_x" - timezone current_darwin_tz + timezone current_macos_tz when "windows" timezone current_windows_tz end diff --git a/spec/unit/resource/timezone_spec.rb b/spec/unit/resource/timezone_spec.rb index 0d4ec21d30..9f27c28d4f 100644 --- a/spec/unit/resource/timezone_spec.rb +++ b/spec/unit/resource/timezone_spec.rb @@ -62,18 +62,18 @@ systemd-timesyncd.service active: yes expect { resource.action :unset }.to raise_error(Chef::Exceptions::ValidationFailed) end - describe "#current_darwin_tz?" do + describe "#current_macos_tz?" do context "with admin privs" do it "returns the TZ" do expect(resource).to receive(:shell_out!).and_return(shellout_systemsetup) - expect(resource.current_darwin_tz).to eql("UTC") + expect(resource.current_macos_tz).to eql("UTC") end end context "without admin privs" do it "returns the TZ" do expect(resource).to receive(:shell_out!).and_return(shellout_systemsetup_fail) - expect { resource.current_darwin_tz }.to raise_error(RuntimeError, "The timezone resource requires administrative privileges to run on macOS hosts!") + expect { resource.current_macos_tz }.to raise_error(RuntimeError, "The timezone resource requires administrative privileges to run on macOS hosts!") end end end |