diff options
author | Tim Smith <tsmith@chef.io> | 2018-02-16 07:25:16 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-16 07:25:16 -0800 |
commit | d44c02c8cf3854c5ad8ced1638eb41d6c4ad7fb4 (patch) | |
tree | 86c71c829f86a1e9dca7c15cedfd0ad42198d3d2 | |
parent | 911026815187c5ed06bb78fe47904e8992353a20 (diff) | |
parent | ab9d42efe4c72eec96ae3d6df9a0fb44a24b694e (diff) | |
download | ohai-d44c02c8cf3854c5ad8ced1638eb41d6c4ad7fb4.tar.gz |
Merge pull request #1134 from chef/tm/bad_tests
fix failing tests on non linux platforms
-rw-r--r-- | spec/unit/plugins/linux/lspci_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/plugins/sysconf_spec.rb | 1 | ||||
-rw-r--r-- | spec/unit/system_spec.rb | 4 |
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 |