diff options
author | Tim Smith <tsmith@chef.io> | 2018-04-17 16:17:59 -0700 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2018-04-17 16:19:32 -0700 |
commit | 2694fb32007a622cfa853c94c74439da79a2a6c5 (patch) | |
tree | 5a8c2f0368c273aaa14746281a28591c9df8436b | |
parent | 0ec2db560aa14d7a37913cccdfab00a8a0abcea4 (diff) | |
download | ohai-dmi_ids.tar.gz |
Add a spec for passing additional DMI IDsdmi_ids
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r-- | spec/unit/plugins/dmi_spec.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/spec/unit/plugins/dmi_spec.rb b/spec/unit/plugins/dmi_spec.rb index b7fa44d9..a8074bf0 100644 --- a/spec/unit/plugins/dmi_spec.rb +++ b/spec/unit/plugins/dmi_spec.rb @@ -142,8 +142,15 @@ describe Ohai::System, "plugin dmi" do end end - it "correctly ignores unwanted data" do + it "allows capturing additional DMI data" do + Ohai.config[:additional_dmi_ids] = [ 16 ] plugin.run - expect(plugin[:dmi][:base_board]).not_to have_key(:error_correction_type) + expect(plugin[:dmi]).to have_key(:physical_memory_array) + end + + it "correctly ignores data in excluded DMI IDs" do + expect(plugin).to receive(:shell_out).with("dmidecode").and_return(mock_shell_out(0, stdout, "")) + plugin.run + expect(plugin[:dmi]).not_to have_key(:physical_memory_array) end end |