From 6998d758248d778fa95b008c78d05473e48b8428 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Thu, 29 Jul 2021 22:11:21 +0200 Subject: Update to ruby/spec@b65d01f --- spec/ruby/core/dir/shared/glob.rb | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'spec/ruby/core/dir/shared/glob.rb') diff --git a/spec/ruby/core/dir/shared/glob.rb b/spec/ruby/core/dir/shared/glob.rb index c35f7d71ca..ae5c2a114b 100644 --- a/spec/ruby/core/dir/shared/glob.rb +++ b/spec/ruby/core/dir/shared/glob.rb @@ -23,14 +23,7 @@ describe :dir_glob, shared: true do Dir.send(@method, obj).should == %w[file_one.ext] end - ruby_version_is ""..."2.6" do - it "splits the string on \\0 if there is only one string given" do - Dir.send(@method, "file_o*\0file_t*").should == - %w!file_one.ext file_two.ext! - end - end - - ruby_version_is "2.6"..."2.7" do + ruby_version_is ""..."2.7" do it "splits the string on \\0 if there is only one string given and warns" do -> { Dir.send(@method, "file_o*\0file_t*").should == @@ -205,6 +198,14 @@ describe :dir_glob, shared: true do Dir.send(@method, '**/').sort.should == expected end + it "recursively matches any subdirectories except './' or '../' with '**/' from the base directory if that is specified" do + expected = %w[ + nested/directory + ] + + Dir.send(@method, '**/*ory', base: 'deeply').sort.should == expected + end + ruby_version_is ''...'3.1' do it "recursively matches any subdirectories including ./ and ../ with '.**/'" do Dir.chdir("#{DirSpecs.mock_dir}/subdir_one") do -- cgit v1.2.3