diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2018-07-02 10:25:16 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2018-07-02 10:25:16 -0700 |
commit | 35603c7ce1bd3ccf35334ed65152140f0ecaf080 (patch) | |
tree | 452c84ce196ce00d672c71a8fa65f86c5a074fac /spec/unit/provider/cron/unix_spec.rb | |
parent | eda2808dce8146bfdb308dd658b1dd565df3562b (diff) | |
download | chef-35603c7ce1bd3ccf35334ed65152140f0ecaf080.tar.gz |
fix Style/HashSyntax
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec/unit/provider/cron/unix_spec.rb')
-rw-r--r-- | spec/unit/provider/cron/unix_spec.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/spec/unit/provider/cron/unix_spec.rb b/spec/unit/provider/cron/unix_spec.rb index 62b941c4aa..843f3f3d8c 100644 --- a/spec/unit/provider/cron/unix_spec.rb +++ b/spec/unit/provider/cron/unix_spec.rb @@ -37,9 +37,9 @@ describe Chef::Provider::Cron::Unix do end end - let(:status) { double("Process::Status", :exitstatus => exitstatus) } + let(:status) { double("Process::Status", exitstatus: exitstatus) } let(:exitstatus) { 0 } - let(:shell_out) { double("Mixlib::ShellOut", :status => status, :stdout => stdout, :stderr => stderr) } + let(:shell_out) { double("Mixlib::ShellOut", status: status, stdout: stdout, stderr: stderr) } let(:logger) { double("Mixlib::Log::Child").as_null_object } @@ -66,12 +66,12 @@ describe Chef::Provider::Cron::Unix do before do allow(logger).to receive(:trace) allow(shell_out).to receive(:format_for_exception).and_return("formatted command output") - allow(provider).to receive(:shell_out).with("/usr/bin/crontab -l", :user => username).and_return(shell_out) + allow(provider).to receive(:shell_out).with("/usr/bin/crontab -l", user: username).and_return(shell_out) end it "should call crontab -l with the user" do provider.send(:read_crontab) - expect(provider).to have_received(:shell_out).with("/usr/bin/crontab -l", :user => username) + expect(provider).to have_received(:shell_out).with("/usr/bin/crontab -l", user: username) end it "should return the contents of the crontab" do @@ -111,7 +111,7 @@ describe Chef::Provider::Cron::Unix do describe "write_crontab" do let(:stdout) { "" } let(:stderr) { "" } - let(:tempfile) { double("foo", :path => "/tmp/foo", :close => true) } + let(:tempfile) { double("foo", path: "/tmp/foo", close: true) } before do expect(Tempfile).to receive(:new).and_return(tempfile) @@ -119,12 +119,12 @@ describe Chef::Provider::Cron::Unix do expect(tempfile).to receive(:chmod).with(420) expect(tempfile).to receive(:close!) allow(tempfile).to receive(:<<) - allow(provider).to receive(:shell_out).with("/usr/bin/crontab #{tempfile.path}", :user => username).and_return(shell_out) + allow(provider).to receive(:shell_out).with("/usr/bin/crontab #{tempfile.path}", user: username).and_return(shell_out) end it "should call crontab for the user" do provider.send(:write_crontab, "Foo") - expect(provider).to have_received(:shell_out).with("/usr/bin/crontab #{tempfile.path}", :user => username) + expect(provider).to have_received(:shell_out).with("/usr/bin/crontab #{tempfile.path}", user: username) end it "should call crontab with a file containing the crontab" do |