From 2636450e06df5fb2e88d155d5b93994d9b452b33 Mon Sep 17 00:00:00 2001 From: Jacob Zaval Date: Fri, 3 Nov 2023 22:36:20 -0700 Subject: [PATCH] update spec Signed-off-by: Jacob Zaval --- spec/unit/plugins/darwin/virtualization_spec.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spec/unit/plugins/darwin/virtualization_spec.rb b/spec/unit/plugins/darwin/virtualization_spec.rb index f3d65ac37..049aa2719 100644 --- a/spec/unit/plugins/darwin/virtualization_spec.rb +++ b/spec/unit/plugins/darwin/virtualization_spec.rb @@ -82,6 +82,7 @@ allow(plugin).to receive(:docker_exists?).and_return(false) plugin[:hardware] = Mash.new plugin[:hardware][:boot_rom_version] = "not_a_vm" + plugin[:hardware][:machine_model] = "not_a_vm" end describe "when detecting OS X virtualization" do @@ -181,5 +182,12 @@ plugin.run expect(plugin[:virtualization]).to eq({ "systems" => {} }) end + + it "sets apple guest if hardware attributes mention VirtualMac" do + plugin[:hardware][:machine_model] = "VirtualMac2,1" + plugin.run + expect(plugin[:virtualization][:system]).to eq("apple") + expect(plugin[:virtualization][:role]).to eq("guest") + end end end