diff options
Diffstat (limited to 'spec/unit/file_access_control_spec.rb')
-rw-r--r-- | spec/unit/file_access_control_spec.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/unit/file_access_control_spec.rb b/spec/unit/file_access_control_spec.rb index ee806b5c3a..de23fea1f3 100644 --- a/spec/unit/file_access_control_spec.rb +++ b/spec/unit/file_access_control_spec.rb @@ -36,7 +36,7 @@ describe Chef::FileAccessControl do @run_context = Chef::RunContext.new(@node, {}, @events) @current_resource = Chef::Resource::File.new("/tmp/different_file.txt") @provider_requirements = Chef::Provider::ResourceRequirements.new(@resource, @run_context) - @provider = double("File provider", :requirements => @provider_requirements, :manage_symlink_access? => false) + @provider = double("File provider", requirements: @provider_requirements, manage_symlink_access?: false) @fac = Chef::FileAccessControl.new(@current_resource, @resource, @provider) end @@ -61,7 +61,7 @@ describe Chef::FileAccessControl do end it "determines the uid of the owner specified by the resource" do - expect(Etc).to receive(:getpwnam).with("toor").and_return(OpenStruct.new(:uid => 2342)) + expect(Etc).to receive(:getpwnam).with("toor").and_return(OpenStruct.new(uid: 2342)) expect(@fac.target_uid).to eq(2342) end @@ -99,7 +99,7 @@ describe Chef::FileAccessControl do # uids. So we have to get ruby and negative uids to smoke the peace pipe # with each other. @resource.owner("nobody") - expect(Etc).to receive(:getpwnam).with("nobody").and_return(OpenStruct.new(:uid => (4294967294))) + expect(Etc).to receive(:getpwnam).with("nobody").and_return(OpenStruct.new(uid: (4294967294))) expect(@fac.target_uid).to eq(-2) end @@ -107,7 +107,7 @@ describe Chef::FileAccessControl do # More: when OSX userIDs are created by ActiveDirectory sync, it tends to use huge numbers # which had been incorrectly wrapped. It does not look like the OSX IDs go below -2 @resource.owner("bigdude") - expect(Etc).to receive(:getpwnam).with("bigdude").and_return(OpenStruct.new(:uid => (4294967286))) + expect(Etc).to receive(:getpwnam).with("bigdude").and_return(OpenStruct.new(uid: (4294967286))) expect(@fac.target_uid).to eq(4294967286) end @@ -153,7 +153,7 @@ describe Chef::FileAccessControl do end it "determines the gid of the group specified by the resource" do - expect(Etc).to receive(:getgrnam).with("wheel").and_return(OpenStruct.new(:gid => 2342)) + expect(Etc).to receive(:getgrnam).with("wheel").and_return(OpenStruct.new(gid: 2342)) expect(@fac.target_gid).to eq(2342) end @@ -294,7 +294,7 @@ describe Chef::FileAccessControl do end it "sets all access controls on a file" do - allow(@fac).to receive(:stat).and_return(OpenStruct.new(:owner => 99, :group => 99, :mode => 0100444)) + allow(@fac).to receive(:stat).and_return(OpenStruct.new(owner: 99, group: 99, mode: 0100444)) @resource.mode(0400) @resource.owner(0) @resource.group(0) |