1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Prefer more descriptive assertion methods

This commit is contained in:
Nobuyoshi Nakada 2020-06-21 11:31:48 +09:00
parent 838d695c16
commit ccd2f99e71
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -616,7 +616,7 @@ class TestPathname < Test::Unit::TestCase
def test_kernel_open
count = 0
result = Kernel.open(Pathname.new(__FILE__)) {|f|
assert(File.identical?(__FILE__, f))
assert_file.identical?(__FILE__, f)
count += 1
2
}
@ -1298,18 +1298,18 @@ class TestPathname < Test::Unit::TestCase
def test_mkdir
with_tmpchdir('rubytest-pathname') {|dir|
Pathname("d").mkdir
assert(File.directory?("d"))
assert_file.directory?("d")
Pathname("e").mkdir(0770)
assert(File.directory?("e"))
assert_file.directory?("e")
}
end
def test_rmdir
with_tmpchdir('rubytest-pathname') {|dir|
Pathname("d").mkdir
assert(File.directory?("d"))
assert_file.directory?("d")
Pathname("d").rmdir
assert(!File.exist?("d"))
assert_file.not_exist?("d")
}
end
@ -1372,16 +1372,16 @@ class TestPathname < Test::Unit::TestCase
def test_mkpath
with_tmpchdir('rubytest-pathname') {|dir|
Pathname("a/b/c/d").mkpath
assert(File.directory?("a/b/c/d"))
assert_file.directory?("a/b/c/d")
}
end
def test_rmtree
with_tmpchdir('rubytest-pathname') {|dir|
Pathname("a/b/c/d").mkpath
assert(File.exist?("a/b/c/d"))
assert_file.exist?("a/b/c/d")
Pathname("a").rmtree
assert(!File.exist?("a"))
assert_file.not_exist?("a")
}
end
@ -1389,10 +1389,10 @@ class TestPathname < Test::Unit::TestCase
with_tmpchdir('rubytest-pathname') {|dir|
open("f", "w") {|f| f.write "abc" }
Pathname("f").unlink
assert(!File.exist?("f"))
assert_file.not_exist?("f")
Dir.mkdir("d")
Pathname("d").unlink
assert(!File.exist?("d"))
assert_file.not_exist?("d")
}
end
@ -1417,7 +1417,7 @@ class TestPathname < Test::Unit::TestCase
end
def test_file_fnmatch
assert(File.fnmatch("*.*", Pathname.new("bar.baz")))
assert_file.fnmatch("*.*", Pathname.new("bar.baz"))
end
def test_relative_path_from_casefold