diff options
author | John McCrae <john.mccrae@progress.com> | 2022-10-03 03:06:46 +0000 |
---|---|---|
committer | John McCrae <john.mccrae@progress.com> | 2022-10-03 03:06:46 +0000 |
commit | 22224c65cb0c84eaf12f244d93390239df47d0fa (patch) | |
tree | 2d7117e8660326667d3ae97d65bf7d14732629d8 | |
parent | ac7f14214b5f90e6805b023932c458821ccd8703 (diff) | |
download | chef-22224c65cb0c84eaf12f244d93390239df47d0fa.tar.gz |
replacing Tempfile.new with Tempfile.create
Signed-off-by: John McCrae <john.mccrae@progress.com>
-rw-r--r-- | spec/unit/provider/cron/unix_spec.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/unit/provider/cron/unix_spec.rb b/spec/unit/provider/cron/unix_spec.rb index e5bb436bea..5d2e1546b6 100644 --- a/spec/unit/provider/cron/unix_spec.rb +++ b/spec/unit/provider/cron/unix_spec.rb @@ -19,6 +19,7 @@ # require "spec_helper" +require "tempfile" unless defined?(Tempfile) describe Chef::Provider::Cron::Unix do @@ -114,10 +115,10 @@ describe Chef::Provider::Cron::Unix do let(:tempfile) { double("foo", path: "/tmp/foo", close: true) } before do - expect(Tempfile).to receive(:new).and_return(tempfile) + expect(Tempfile).to receive(:create).and_return(tempfile) expect(tempfile).to receive(:flush) expect(tempfile).to receive(:chmod).with(420) - expect(tempfile).to receive(:close!) + expect(tempfile).to receive(:close) allow(tempfile).to receive(:<<) allow(provider).to receive(:shell_out_compacted).with("/usr/bin/crontab", tempfile.path, user: username).and_return(shell_out) end |