67 lines
2.2 KiB
Diff
67 lines
2.2 KiB
Diff
From 47eae0ac7be216b2f09a8cf68ba9863751c805d3 Mon Sep 17 00:00:00 2001
|
|
From: chen-jan <chen_aka_jan@163.com>
|
|
Date: Wed, 2 Aug 2023 11:04:02 +0800
|
|
Subject: [PATCH] Replace deprecated File.exists? with File.exist?
|
|
|
|
---
|
|
spec/lib/mini_magick/image_spec.rb | 12 ++++++------
|
|
1 file changed, 6 insertions(+), 6 deletions(-)
|
|
|
|
diff --git a/spec/lib/mini_magick/image_spec.rb b/spec/lib/mini_magick/image_spec.rb
|
|
index 74203b1..449956d 100644
|
|
--- a/spec/lib/mini_magick/image_spec.rb
|
|
+++ b/spec/lib/mini_magick/image_spec.rb
|
|
@@ -119,7 +119,7 @@ require "webmock/rspec"
|
|
|
|
it "creates an image" do
|
|
image = create
|
|
- expect(File.exists?(image.path)).to eq true
|
|
+ expect(File.exist?(image.path)).to eq true
|
|
end
|
|
|
|
it "validates the image if validation is set" do
|
|
@@ -245,12 +245,12 @@ require "webmock/rspec"
|
|
cache_path = image.path.sub(/mpc$/, "cache")
|
|
image.format("png")
|
|
|
|
- expect(File.exists?(cache_path)).to eq false
|
|
+ expect(File.exist?(cache_path)).to eq false
|
|
end
|
|
|
|
it "doesn't delete itself when formatted to the same format" do
|
|
subject.format(subject.type.downcase)
|
|
- expect(File.exists?(subject.path)).to eq true
|
|
+ expect(File.exist?(subject.path)).to eq true
|
|
end
|
|
|
|
it "reformats multi-image formats to multiple images" do
|
|
@@ -693,14 +693,14 @@ require "webmock/rspec"
|
|
image = described_class.open(image_path)
|
|
image.destroy!
|
|
|
|
- expect(File.exists?(image.path)).to eq false
|
|
+ expect(File.exist?(image.path)).to eq false
|
|
end
|
|
|
|
it "doesn't delete when there is no tempfile" do
|
|
image = described_class.new(image_path)
|
|
image.destroy!
|
|
|
|
- expect(File.exists?(image.path)).to eq true
|
|
+ expect(File.exist?(image.path)).to eq true
|
|
end
|
|
|
|
it "deletes .cache files generated by handling .mpc files" do
|
|
@@ -708,7 +708,7 @@ require "webmock/rspec"
|
|
image.format("mpc")
|
|
image.destroy!
|
|
|
|
- expect(File.exists?(image.path.sub(/mpc$/, "cache"))).to eq false
|
|
+ expect(File.exist?(image.path.sub(/mpc$/, "cache"))).to eq false
|
|
end
|
|
end
|
|
|
|
--
|
|
2.41.0
|
|
|