summaryrefslogtreecommitdiff
path: root/spec/unit/plugins/root_group_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/plugins/root_group_spec.rb')
-rw-r--r--spec/unit/plugins/root_group_spec.rb24
1 files changed, 14 insertions, 10 deletions
diff --git a/spec/unit/plugins/root_group_spec.rb b/spec/unit/plugins/root_group_spec.rb
index 77eff706..910c6ca2 100644
--- a/spec/unit/plugins/root_group_spec.rb
+++ b/spec/unit/plugins/root_group_spec.rb
@@ -19,12 +19,12 @@
require "spec_helper"
describe Ohai::System, "root_group" do
- before(:each) do
+ before do
@plugin = get_plugin("root_group")
end
describe "unix platform", :unix_only do
- before(:each) do
+ before do
# this is deeply intertwingled. unfortunately, the law of demeter
# apparently didn't apply to this api. we're just trying to fake
# Etc.getgrgid(Etc.getpwnam('root').gid).name
@@ -36,30 +36,33 @@ describe Ohai::System, "root_group" do
end
describe "with wheel group" do
- before(:each) do
+ before do
allow(@grgid).to receive(:name).and_return("wheel")
end
- it "should have a root_group of wheel" do
+
+ it "has a root_group of wheel" do
@plugin.run
expect(@plugin[:root_group]).to eq("wheel")
end
end
describe "with root group" do
- before(:each) do
+ before do
allow(@grgid).to receive(:name).and_return("root")
end
- it "should have a root_group of root" do
+
+ it "has a root_group of root" do
@plugin.run
expect(@plugin[:root_group]).to eq("root")
end
end
describe "platform aix with system group" do
- before(:each) do
+ before do
allow(@grgid).to receive(:name).and_return("system")
end
- it "should have a root_group of system" do
+
+ it "has a root_group of system" do
@plugin.run
expect(@plugin[:root_group]).to eq("system")
end
@@ -70,11 +73,12 @@ describe Ohai::System, "root_group" do
let(:wmi) { double("wmi", { query: "" }) }
- before(:each) do
+ before do
allow(WmiLite::Wmi).to receive(:new).and_return(wmi)
allow(@plugin).to receive(:collect_os).and_return(:windows)
end
- it "should return the group Administrators" do
+
+ it "returns 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")