From bbdf084bb8aea261abbc18e497e1060d61fdc187 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Sat, 10 Jun 2017 20:16:42 -0700 Subject: Add a spec for clearos platform detection Signed-off-by: Tim Smith --- spec/unit/plugins/linux/platform_spec.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spec/unit/plugins/linux/platform_spec.rb b/spec/unit/plugins/linux/platform_spec.rb index 1cd544ca..00f1425c 100644 --- a/spec/unit/plugins/linux/platform_spec.rb +++ b/spec/unit/plugins/linux/platform_spec.rb @@ -429,6 +429,14 @@ OS_RELEASE expect(@plugin[:platform_version].to_i).to eq(13) end + it "should read the platform as clearos and version as 7.3" do + expect(File).to receive(:read).with("/etc/redhat-release").and_return("ClearOS release 7.3.0 (Final)") + @plugin.run + expect(@plugin[:platform]).to eq("clearos") + expect(@plugin[:platform_family]).to eq("rhel") + expect(@plugin[:platform_version].to_f).to eq(7.3) + end + # https://github.com/chef/ohai/issues/560 # Issue is seen on EL7, so that's what we're testing. context "on versions that have /etc/os-release" do -- cgit v1.2.1