From ab638662a903c239c2e42842f3a0950877653fef Mon Sep 17 00:00:00 2001 From: Anton Kvashenkin Date: Wed, 12 Sep 2018 22:55:52 +0300 Subject: Fix rspec unit test for root_group plugin Signed-off-by: Anton Kvashenkin --- spec/unit/plugins/root_group_spec.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spec/unit/plugins/root_group_spec.rb b/spec/unit/plugins/root_group_spec.rb index 705acd77..4ac2a2b0 100644 --- a/spec/unit/plugins/root_group_spec.rb +++ b/spec/unit/plugins/root_group_spec.rb @@ -77,11 +77,14 @@ describe Ohai::System, "root_group" do end describe "windows platform" do + + let(:wmi) { double("wmi", { query: "" }) } + before(:each) do allow(WmiLite::Wmi).to receive(:new).and_return(wmi) - allow(plugin).to receive(:collect_os).and_return(:windows) + allow(@plugin).to receive(:collect_os).and_return(:windows) end - it "should return the group administrators" do + it "should return the group Administrators" do expect(wmi) .to receive(:query) .with("select * from Win32_Group where sid like 'S-1-5-32-544' and LocalAccount=True") -- cgit v1.2.1