summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSalim Alam <salam@chef.io>2016-04-13 15:23:35 -0700
committerSalim Alam <salam@chef.io>2016-04-13 15:23:35 -0700
commit73b09610eafc554b57754fff89352013656f6ef3 (patch)
tree1e4da5fe6fcb5f51f95ee8eb75d35e626f78eedf
parentc049c4e450170cd14eb021c4481ff033b0cf97a3 (diff)
parentcd7fcf377710e4da4e32c8488d0ecf772573fb25 (diff)
downloadohai-73b09610eafc554b57754fff89352013656f6ef3.tar.gz
Merge pull request #798 from chef/salam/fix-plugin
Don't execute .so libs for Windows
-rw-r--r--lib/ohai/plugins/c.rb2
-rw-r--r--spec/unit/plugins/c_spec.rb8
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/ohai/plugins/c.rb b/lib/ohai/plugins/c.rb
index 7817fc86..81271f80 100644
--- a/lib/ohai/plugins/c.rb
+++ b/lib/ohai/plugins/c.rb
@@ -53,7 +53,7 @@ Ohai.plugin(:C) do
c[:glibc][:version] = $1
c[:glibc][:description] = description
end
- end unless c[:glibc]
+ end unless c[:glibc] || ::RbConfig::CONFIG["host_os"] =~ /mswin|mingw32|windows/
end
#ms cl
diff --git a/spec/unit/plugins/c_spec.rb b/spec/unit/plugins/c_spec.rb
index 5b542f4e..322d396f 100644
--- a/spec/unit/plugins/c_spec.rb
+++ b/spec/unit/plugins/c_spec.rb
@@ -153,17 +153,17 @@ describe Ohai::System, "plugin c" do
end
#glibc
- it "gets the glibc x.x.x version from running /lib/libc.so.6" do
+ it "gets the glibc x.x.x version from running /lib/libc.so.6", :unix_only do
expect(plugin).to receive(:shell_out).with("/lib/libc.so.6").and_return(mock_shell_out(0, C_GLIBC_2_3_4, ""))
plugin.run
end
- it "sets languages[:c][:glibc][:version]" do
+ it "sets languages[:c][:glibc][:version]", :unix_only do
plugin.run
expect(plugin.languages[:c][:glibc][:version]).to eql("2.3.4")
end
- it "sets languages[:c][:glibc][:description]" do
+ it "sets languages[:c][:glibc][:description]", :unix_only do
plugin.run
expect(plugin.languages[:c][:glibc][:description]).to eql(C_GLIBC_2_3_4.split($/).first)
end
@@ -183,7 +183,7 @@ describe Ohai::System, "plugin c" do
expect(plugin[:languages][:c]).not_to be_empty # expect other attributes
end
- it "gets the glibc x.x version from running /lib/libc.so.6" do
+ it "gets the glibc x.x version from running /lib/libc.so.6", :unix_only do
allow(plugin).to receive(:shell_out).with("/lib/libc.so.6").and_return(mock_shell_out(0, C_GLIBC_2_5, ""))
expect(plugin).to receive(:shell_out).with("/lib/libc.so.6").and_return(mock_shell_out(0, C_GLIBC_2_5, ""))
plugin.run