mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Match File.exist?
This commit is contained in:
parent
13193bf5ae
commit
5f7b80a6d6
5 changed files with 9 additions and 9 deletions
|
@ -15,7 +15,7 @@ class ActiveFile::Site
|
|||
raise NotImplementedError
|
||||
end
|
||||
|
||||
def exists?(key)
|
||||
def exist?(key)
|
||||
raise NotImplementedError
|
||||
end
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ class ActiveFile::Sites::DiskSite < ActiveFile::Site
|
|||
File.delete path_for(key)
|
||||
end
|
||||
|
||||
def exists?(key)
|
||||
def exist?(key)
|
||||
File.exist? path_for(key)
|
||||
end
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@ class ActiveFile::Sites::MirrorSite < ActiveFile::Site
|
|||
perform_across_sites :delete, key
|
||||
end
|
||||
|
||||
def exists?(key)
|
||||
perform_across_sites(:exists?, key).any?
|
||||
def exist?(key)
|
||||
perform_across_sites(:exist?, key).any?
|
||||
end
|
||||
|
||||
|
||||
|
|
|
@ -24,8 +24,8 @@ class ActiveFile::Sites::S3Site < ActiveFile::Site
|
|||
object_for(key).delete
|
||||
end
|
||||
|
||||
def exists?(key)
|
||||
object_for(key).exists?
|
||||
def exist?(key)
|
||||
object_for(key).exist?
|
||||
end
|
||||
|
||||
|
||||
|
|
|
@ -32,13 +32,13 @@ class ActiveFile::DiskSiteTest < ActiveSupport::TestCase
|
|||
end
|
||||
|
||||
test "existing" do
|
||||
assert @site.exists?(FIXTURE_KEY)
|
||||
assert_not @site.exists?(FIXTURE_KEY + "nonsense")
|
||||
assert @site.exist?(FIXTURE_KEY)
|
||||
assert_not @site.exist?(FIXTURE_KEY + "nonsense")
|
||||
end
|
||||
|
||||
test "deleting" do
|
||||
@site.delete FIXTURE_KEY
|
||||
assert_not @site.exists?(FIXTURE_KEY)
|
||||
assert_not @site.exist?(FIXTURE_KEY)
|
||||
end
|
||||
|
||||
test "sizing" do
|
||||
|
|
Loading…
Reference in a new issue