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.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/ruby/core/dir/shared/glob.rb b/spec/ruby/core/dir/shared/glob.rb
index 2fe22ac6c3..88ceb82c50 100644
--- a/spec/ruby/core/dir/shared/glob.rb
+++ b/spec/ruby/core/dir/shared/glob.rb
@@ -32,6 +32,15 @@ describe :dir_glob, shared: true do
end
end
+ ruby_version_is "2.6" 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 ==
+ %w!file_one.ext file_two.ext!
+ }.should complain(/warning: use glob patterns list instead of nul-separated patterns/)
+ end
+ end
+
it "matches non-dotfiles with '*'" do
expected = %w[
brace