summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-08-18 14:22:18 -0700
committerTim Smith <tsmith84@gmail.com>2020-08-18 14:22:18 -0700
commit2a003da0ad960c7cb6784174fd111ebf69fd427e (patch)
tree7298607e5df845d4802192441a432258467fdb74
parent5034aeaccc9e70be5bedd994893a010a9c19842c (diff)
downloadchef-2a003da0ad960c7cb6784174fd111ebf69fd427e.tar.gz
Add a spec for the legacy RHEL state loading
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--spec/unit/resource/timezone_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/unit/resource/timezone_spec.rb b/spec/unit/resource/timezone_spec.rb
index a0205b8d06..8ba033f072 100644
--- a/spec/unit/resource/timezone_spec.rb
+++ b/spec/unit/resource/timezone_spec.rb
@@ -91,4 +91,12 @@ systemd-timesyncd.service active: yes
expect(resource.current_windows_tz).to eql("UTC")
end
end
+
+ describe "#current_rhel_tz?" do
+ it "returns the TZ" do
+ allow(File).to receive(:exist?).with("/etc/sysconfig/clock").and_return true
+ expect(File).to receive(:read).with("/etc/sysconfig/clock").and_return 'ZONE="UTC"'
+ expect(resource.current_rhel_tz).to eql("UTC")
+ end
+ end
end