spec/unit/plugins/root_group_spec.rb in ohai-8.10.0 vs spec/unit/plugins/root_group_spec.rb in ohai-8.11.1

- old
+ new

@@ -14,75 +14,75 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # -require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper.rb') -require File.expand_path(File.dirname(__FILE__) + '/../../../lib/ohai/util/win32/group_helper.rb') +require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb") +require File.expand_path(File.dirname(__FILE__) + "/../../../lib/ohai/util/win32/group_helper.rb") -describe Ohai::System, 'root_group' do +describe Ohai::System, "root_group" do before(:each) do @plugin = get_plugin("root_group") end - describe 'unix platform', :unix_only do + describe "unix platform", :unix_only do before(:each) 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 @pwnam = Object.new allow(@pwnam).to receive(:gid).and_return(0) - allow(Etc).to receive(:getpwnam).with('root').and_return(@pwnam) + allow(Etc).to receive(:getpwnam).with("root").and_return(@pwnam) @grgid = Object.new allow(Etc).to receive(:getgrgid).and_return(@grgid) end - describe 'with wheel group' do + describe "with wheel group" do before(:each) do - allow(@grgid).to receive(:name).and_return('wheel') + allow(@grgid).to receive(:name).and_return("wheel") end - it 'should have a root_group of wheel' do + it "should have a root_group of wheel" do @plugin.run - expect(@plugin[:root_group]).to eq('wheel') + expect(@plugin[:root_group]).to eq("wheel") end end - describe 'with root group' do + describe "with root group" do before(:each) do - allow(@grgid).to receive(:name).and_return('root') + allow(@grgid).to receive(:name).and_return("root") end - it 'should have a root_group of root' do + it "should have a root_group of root" do @plugin.run - expect(@plugin[:root_group]).to eq('root') + expect(@plugin[:root_group]).to eq("root") end end - describe 'platform hpux with sys group' do + describe "platform hpux with sys group" do before(:each) do allow(@pwnam).to receive(:gid).and_return(3) - allow(@grgid).to receive(:name).and_return('sys') + allow(@grgid).to receive(:name).and_return("sys") end - it 'should have a root_group of sys' do + it "should have a root_group of sys" do @plugin.run - expect(@plugin[:root_group]).to eq('sys') + expect(@plugin[:root_group]).to eq("sys") end end - describe 'platform aix with system group' do + describe "platform aix with system group" do before(:each) do - allow(@grgid).to receive(:name).and_return('system') + allow(@grgid).to receive(:name).and_return("system") end - it 'should have a root_group of system' do + it "should have a root_group of system" do @plugin.run - expect(@plugin[:root_group]).to eq('system') + expect(@plugin[:root_group]).to eq("system") end end end - describe 'windows platform' do - it 'should return the group administrators' do - stub_const('::RbConfig::CONFIG', { 'host_os' => 'windows'} ) - expect(Ohai::Util::Win32::GroupHelper).to receive(:windows_root_group_name).and_return('administrators') + describe "windows platform" do + it "should return the group administrators" do + stub_const("::RbConfig::CONFIG", { "host_os" => "windows" } ) + expect(Ohai::Util::Win32::GroupHelper).to receive(:windows_root_group_name).and_return("administrators") @plugin.run - expect(@plugin[:root_group]).to eq('administrators') + expect(@plugin[:root_group]).to eq("administrators") end end end