diff options
author | Tim Smith <tsmith@chef.io> | 2020-11-24 10:43:37 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-24 10:43:37 -0800 |
commit | d8cb8fba509dd7616e515bd5a33f1aee06bea90b (patch) | |
tree | 180d704279ee761fe72613ae33dfdec59f2bd918 /spec | |
parent | e43cf8d2e6584fdba95be470148ac55efaaa3622 (diff) | |
parent | 2ae04e544f05e448b283355c865053456f6d242f (diff) | |
download | ohai-d8cb8fba509dd7616e515bd5a33f1aee06bea90b.tar.gz |
Merge pull request #1583 from chef/xlc
Fix XLC compiler detection to support 3 part version numbers
Diffstat (limited to 'spec')
-rw-r--r-- | spec/unit/plugins/c_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/unit/plugins/c_spec.rb b/spec/unit/plugins/c_spec.rb index e295e0ca..0b895291 100644 --- a/spec/unit/plugins/c_spec.rb +++ b/spec/unit/plugins/c_spec.rb @@ -65,6 +65,11 @@ C_XLC = <<~EOF.freeze Version: 09.00.0000.0000 EOF +C_XLC_NEWER = <<~EOF.freeze + IBM XL C/C++ for AIX, V13.1.3 (5725-C72, 5765-J07) + Version: 13.01.0003.0000 +EOF + C_SUN = <<~EOF.freeze cc: Sun C 5.8 Patch 121016-06 2007/08/01 EOF @@ -108,6 +113,13 @@ describe Ohai::System, "plugin c" do expect(plugin[:languages][:c]).not_to have_key(:xlc) end + it "properly parses 3 part version numbers in newer XLC releases" do + expect(plugin).to receive(:shell_out).with("xlc -qversion").and_return(mock_shell_out(0, C_XLC_NEWER, "")) + plugin.run + expect(plugin.languages[:c][:xlc][:version]).to eql("13.1.3") + expect(plugin.languages[:c][:xlc][:description]).to eql("IBM XL C/C++ for AIX, V13.1.3 (5725-C72, 5765-J07)") + end + it "does not set the languages[:c][:xlc] tree up if xlc command fails" do allow(plugin).to receive(:shell_out).with("xlc -qversion").and_raise(Ohai::Exceptions::Exec) plugin.run |