diff --git a/.rubocop.yml b/.rubocop.yml index 7e9941d1d..d44255479 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -179,6 +179,9 @@ Lint/EmptyFile: Lint/LiteralAsCondition: Enabled: true +Lint/NonAtomicFileOperation: + Enabled: true + Lint/ParenthesesAsGroupedExpression: Enabled: true diff --git a/spec/lib/tasks/sitemap_spec.rb b/spec/lib/tasks/sitemap_spec.rb index d72bb9061..dc2fa7edd 100644 --- a/spec/lib/tasks/sitemap_spec.rb +++ b/spec/lib/tasks/sitemap_spec.rb @@ -4,7 +4,7 @@ describe "rake sitemap:create", type: :system do let(:file) { Rails.root.join("public", "sitemap.xml") } before do - File.delete(file) if File.exist?(file) + FileUtils.rm_f(file) Rake::Task["sitemap:create"].reenable end