From 60a74f0a142839ea3d494719f1ec5d2f5258dcd7 Mon Sep 17 00:00:00 2001 From: Herwin Date: Mon, 4 Sep 2023 11:20:04 +0200 Subject: [PATCH] Refresh specs for Dir.exists? and File.exists? This follows upstream change https://github.com/ruby/spec/pull/1065 --- spec/core/dir/exist_spec.rb | 8 ++++++++ spec/core/file/exist_spec.rb | 8 ++++++++ spec/shared/file/exist.rb | 5 ----- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/spec/core/dir/exist_spec.rb b/spec/core/dir/exist_spec.rb index 43987b0f3..9023de533 100644 --- a/spec/core/dir/exist_spec.rb +++ b/spec/core/dir/exist_spec.rb @@ -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 diff --git a/spec/core/file/exist_spec.rb b/spec/core/file/exist_spec.rb index ddb5febcb..263337688 100644 --- a/spec/core/file/exist_spec.rb +++ b/spec/core/file/exist_spec.rb @@ -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 diff --git a/spec/shared/file/exist.rb b/spec/shared/file/exist.rb index 3bd97711b..67424146c 100644 --- a/spec/shared/file/exist.rb +++ b/spec/shared/file/exist.rb @@ -4,11 +4,6 @@ @object.send(@method, 'a_fake_file').should == false end - it "returns true if the file exist using the alias exists?" do - @object.send(@method, __FILE__).should == true - @object.send(@method, 'a_fake_file').should == false - end - it "raises an ArgumentError if not passed one argument" do -> { @object.send(@method) }.should raise_error(ArgumentError) -> { @object.send(@method, __FILE__, __FILE__) }.should raise_error(ArgumentError)