aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Hashizume <michael.hashizume@puppet.com>2023-02-10 10:45:29 -0800
committerMichael Hashizume <michael.hashizume@puppet.com>2023-02-10 10:45:29 -0800
commitcf562a8bda5df98b91fea01a43e128a8e821058c (patch)
tree8899856b8ddee28d69fb009be3287a3fb331b48d
parent66d5fdf3b51188ddedac4baad6f5c1621db862f2 (diff)
downloadpuppet-cron_core-cf562a8bda5df98b91fea01a43e128a8e821058c.tar.gz
puppet-cron_core-cf562a8bda5df98b91fea01a43e128a8e821058c.tar.bz2
(maint) Rubocop implicit begin fix
This commit addresses the Rubocop Style/RedundantBegin cop and removes an explicit `begin` block in favor of implicit syntax.
-rw-r--r--spec/lib/puppet_spec/files.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/spec/lib/puppet_spec/files.rb b/spec/lib/puppet_spec/files.rb
index 7a43100..53e0e17 100644
--- a/spec/lib/puppet_spec/files.rb
+++ b/spec/lib/puppet_spec/files.rb
@@ -9,12 +9,10 @@ module PuppetSpec::Files
# rubocop:disable Style/GlobalVars
$global_tempfiles ||= []
$global_tempfiles.each do |path|
- begin
- allow(Dir).to receive(:entries).and_call_original
- FileUtils.rm_rf path, secure: true
- rescue Errno::ENOENT
- # nothing to do
- end
+ allow(Dir).to receive(:entries).and_call_original
+ FileUtils.rm_rf path, secure: true
+ rescue Errno::ENOENT
+ # nothing to do
end
$global_tempfiles = []
# rubocop:enable Style/GlobalVars