summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/pathname/test_pathname.rb2
-rw-r--r--test/ruby/test_dir.rb5
2 files changed, 5 insertions, 2 deletions
diff --git a/test/pathname/test_pathname.rb b/test/pathname/test_pathname.rb
index 43cef4849f..2c07f77511 100644
--- a/test/pathname/test_pathname.rb
+++ b/test/pathname/test_pathname.rb
@@ -1266,7 +1266,7 @@ class TestPathname < Test::Unit::TestCase
open("f", "w") {|f| f.write "abc" }
Dir.chdir("/") {
assert_equal(
- [Pathname("."), Pathname(".."), Pathname("f")],
+ [Pathname("."), Pathname("f")],
Pathname.glob("*", File::FNM_DOTMATCH, base: dir).sort)
}
}
diff --git a/test/ruby/test_dir.rb b/test/ruby/test_dir.rb
index e5bcbeac73..bc91be4abf 100644
--- a/test/ruby/test_dir.rb
+++ b/test/ruby/test_dir.rb
@@ -165,7 +165,7 @@ class TestDir < Test::Unit::TestCase
end
def test_glob
- assert_equal((%w(. ..) + ("a".."z").to_a).map{|f| File.join(@root, f) },
+ assert_equal((%w(.) + ("a".."z").to_a).map{|f| File.join(@root, f) },
Dir.glob(File.join(@root, "*"), File::FNM_DOTMATCH))
assert_equal([@root] + ("a".."z").map {|f| File.join(@root, f) },
Dir.glob([@root, File.join(@root, "*")]))
@@ -203,6 +203,9 @@ class TestDir < Test::Unit::TestCase
Dir.chdir(@root) do
assert_include(Dir.glob("a/**/*", File::FNM_DOTMATCH), "a/.", bug8006)
+ Dir.mkdir("a/b")
+ assert_not_include(Dir.glob("a/**/*", File::FNM_DOTMATCH), "a/b/.")
+
FileUtils.mkdir_p("a/b/c/d/e/f")
assert_equal(["a/b/c/d/e/f"], Dir.glob("a/**/e/f"), bug6977)
assert_equal(["a/b/c/d/e/f"], Dir.glob("a/**/d/e/f"), bug6977)