From cea5f5aaee52ef756a6f7c200b0b37f9c63c01c0 Mon Sep 17 00:00:00 2001 From: akr Date: Sat, 21 Oct 2017 08:34:49 +0000 Subject: Pathname#glob method implemented. [ruby-core:49373] [Feature #7360] proposed by Alexander E. Fischer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/pathname/test_pathname.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/pathname') diff --git a/test/pathname/test_pathname.rb b/test/pathname/test_pathname.rb index 1efd40121d..d0c2aa18ca 100644 --- a/test/pathname/test_pathname.rb +++ b/test/pathname/test_pathname.rb @@ -1250,6 +1250,19 @@ class TestPathname < Test::Unit::TestCase assert_kind_of(Pathname, wd) end + def test_glob + with_tmpchdir('rubytest-pathname') {|dir| + Dir.mkdir("d") + open("d/f", "w") {|f| f.write "abc" } + Dir.mkdir("d/e") + assert_equal([Pathname("d/e"), Pathname("d/f")], Pathname("d").glob("*").sort) + a = [] + Pathname("d").glob("*") {|path| a << path } + a.sort! + assert_equal([Pathname("d/e"), Pathname("d/f")], a) + } + end + def test_entries with_tmpchdir('rubytest-pathname') {|dir| open("a", "w") {} -- cgit v1.2.3