summaryrefslogtreecommitdiff
path: root/spec/ruby/core/dir/shared/glob.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/dir/shared/glob.rb')
-rw-r--r--spec/ruby/core/dir/shared/glob.rb17
1 files changed, 9 insertions, 8 deletions
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