diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-11-18 21:47:18 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-18 21:47:18 +0900 |
commit | 89b440bf724b5e670da0fa31c36a7945a7ddc80f (patch) | |
tree | daa36283f6064ce209b62fb97422a8d41da6a63c /test/ruby | |
parent | 68963244658ef7dacd48affcb2afca29419e847e (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.rb | 6 |
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, "*/"))) |