summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-11-18 21:47:18 +0900
committerGitHub <noreply@github.com>2021-11-18 21:47:18 +0900
commit89b440bf724b5e670da0fa31c36a7945a7ddc80f (patch)
treedaa36283f6064ce209b62fb97422a8d41da6a63c /test/ruby
parent68963244658ef7dacd48affcb2afca29419e847e (diff)
Expect bool as `sort:` option at glob [Feature #18287]
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/5084 Merged-By: nobu <nobu@ruby-lang.org>
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_dir.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_dir.rb b/test/ruby/test_dir.rb
index 3e03d7c7bc..9474c6e927 100644
--- a/test/ruby/test_dir.rb
+++ b/test/ruby/test_dir.rb
@@ -176,6 +176,12 @@ class TestDir < Test::Unit::TestCase
assert_raise_with_message(ArgumentError, /nul-separated/) do
Dir.glob(@root + "\0\0\0" + File.join(@root, "*"))
end
+ assert_raise_with_message(ArgumentError, /expected true or false/) do
+ Dir.glob(@root, sort: 1)
+ end
+ assert_raise_with_message(ArgumentError, /expected true or false/) do
+ Dir.glob(@root, sort: nil)
+ end
assert_equal(("a".."z").step(2).map {|f| File.join(File.join(@root, f), "") },
Dir.glob(File.join(@root, "*/")))