Skip to content

Commit

Permalink
deprecated File.exists? --> File.exist?
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Evans committed Sep 2, 2024
1 parent 67f7b4b commit 14f1984
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions spec/dragonfly/file_data_store_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ def touch_file(filename)
end

def assert_exists(path)
File.exists?(path).should be_truthy
File.exist?(path).should be_truthy
end

def assert_does_not_exist(path)
File.exists?(path).should be_falsey
File.exist?(path).should be_falsey
end

def assert_contains(dir, filepattern)
Expand Down
8 changes: 4 additions & 4 deletions spec/dragonfly/temp_object_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ def get_parts(temp_object)
describe "to_file" do
before(:each) do
@filename = 'tmp/eggnog.txt'
FileUtils.rm_f(@filename) if File.exists?(@filename)
FileUtils.rm_f(@filename) if File.exist?(@filename)
end
after(:each) do
FileUtils.rm_f(@filename) if File.exists?(@filename)
FileUtils.rm_f(@filename) if File.exist?(@filename)
end
it "should write to a file" do
@temp_object.to_file(@filename)
File.exists?(@filename).should be_truthy
File.exist?(@filename).should be_truthy
end
it "should write the correct data to the file" do
@temp_object.to_file(@filename)
Expand All @@ -140,7 +140,7 @@ def get_parts(temp_object)
it "should create intermediate subdirs" do
filename = 'tmp/gog/mcgee'
@temp_object.to_file(filename)
File.exists?(filename).should be_truthy
File.exist?(filename).should be_truthy
FileUtils.rm_rf('tmp/gog')
end
it "should allow not creating intermediate subdirs" do
Expand Down

0 comments on commit 14f1984

Please sign in to comment.