summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThom May <thom@chef.io>2018-02-16 13:08:03 +0000
committerThom May <thom@chef.io>2018-02-16 13:08:27 +0000
commitab9d42efe4c72eec96ae3d6df9a0fb44a24b694e (patch)
tree86c71c829f86a1e9dca7c15cedfd0ad42198d3d2
parent911026815187c5ed06bb78fe47904e8992353a20 (diff)
downloadohai-tm/bad_tests.tar.gz
fix failing tests on non linux platformstm/bad_tests
Signed-off-by: Thom May <thom@chef.io>
-rw-r--r--spec/unit/plugins/linux/lspci_spec.rb2
-rw-r--r--spec/unit/plugins/sysconf_spec.rb1
-rw-r--r--spec/unit/system_spec.rb4
3 files changed, 6 insertions, 1 deletions
diff --git a/spec/unit/plugins/linux/lspci_spec.rb b/spec/unit/plugins/linux/lspci_spec.rb
index 60454559..074068bb 100644
--- a/spec/unit/plugins/linux/lspci_spec.rb
+++ b/spec/unit/plugins/linux/lspci_spec.rb
@@ -20,8 +20,8 @@ require_relative "../../../spec_helper.rb"
describe Ohai::System, "Linux lspci plugin" do
let (:plugin) { get_plugin("linux/lspci") }
-
before(:each) do
+ allow(plugin).to receive(:collect_os).and_return(:linux)
@stdout = <<LSPCI
Device: 00:1f.3
Class: Audio device [0403]
diff --git a/spec/unit/plugins/sysconf_spec.rb b/spec/unit/plugins/sysconf_spec.rb
index 3edf600a..ad67c893 100644
--- a/spec/unit/plugins/sysconf_spec.rb
+++ b/spec/unit/plugins/sysconf_spec.rb
@@ -346,6 +346,7 @@ _POSIX_RAW_SOCKETS 200809
GETCONF_OUT
allow(plugin).to receive(:which).with("getconf").and_return("/usr/bin/getconf")
allow(plugin).to receive(:shell_out).with("/usr/bin/getconf -a").and_return(mock_shell_out(0, getconf_out, ""))
+ allow(plugin).to receive(:collect_os).and_return(:linux)
plugin.run
expect(plugin[:sysconf].to_hash).to eq({
"LINK_MAX" => 65000,
diff --git a/spec/unit/system_spec.rb b/spec/unit/system_spec.rb
index edaa202f..9212e145 100644
--- a/spec/unit/system_spec.rb
+++ b/spec/unit/system_spec.rb
@@ -94,7 +94,9 @@ end
EOF
with_plugin("repo1/lake.rb", <<EOF)
+Ohai.plugin(:Nature) do
provides 'fish'
+end
EOF
with_plugin("repo2/nature.rb", <<EOF)
@@ -104,7 +106,9 @@ end
EOF
with_plugin("repo2/mountain.rb", <<EOF)
+Ohai.plugin(:Nature) do
provides 'bear'
+end
EOF
before do