Skip to content

Commit

Permalink
Add checks to see if Dir.exists? and File.exists? are gone
Browse files Browse the repository at this point in the history
They have been removed in Ruby 3.2 (Feature #17391)
  • Loading branch information
herwinw committed Sep 1, 2023
1 parent 83af4e3 commit 765b288
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/dir/exist_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,11 @@

it_behaves_like :dir_exist, :exist?
end

ruby_version_is "3.2" do
describe "Dir.exists?" do
it "has been removed" do
Dir.should_not.respond_to?(:exists?)
end
end
end
8 changes: 8 additions & 0 deletions core/file/exist_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,11 @@
describe "File.exist?" do
it_behaves_like :file_exist, :exist?, File
end

ruby_version_is "3.2" do
describe "File.exists?" do
it "has been removed" do
File.should_not.respond_to?(:exists?)
end
end
end

0 comments on commit 765b288

Please sign in to comment.