diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-23 13:47:36 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-23 13:47:36 +0000 |
commit | ff9928cb1a7adc0ea2bea81dbe43791b980a8eda (patch) | |
tree | ef124e40608ebc586a0aca52f0117624bb8c88ed /test/ruby/test_dir.rb | |
parent | 8ce98152393b53d9f490152dc5593ae1ba69c377 (diff) | |
download | ruby-ff9928cb1a7adc0ea2bea81dbe43791b980a8eda.tar.gz |
Dir.glob base option
* dir.c (dir_s_aref, dir_s_glob): add new optional keyword
argument, `base`. [Feature#13056]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_dir.rb')
-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 553f1aef63..d3fd1be2ec 100644 --- a/test/ruby/test_dir.rb +++ b/test/ruby/test_dir.rb @@ -202,6 +202,12 @@ class TestDir < Test::Unit::TestCase end end + def test_glob_base + files = %w[a/foo.c c/bar.c].map {|n| File.join(@root, n)} + files.each {|n| File.write(n, "")} + assert_equal(files, Dir.glob("*/*.c", base: @root)) + end + def assert_entries(entries) entries.sort! assert_equal(%w(. ..) + ("a".."z").to_a, entries) |