summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-06-21 11:31:48 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-06-21 11:31:48 +0900
commitccd2f99e71162bddc24bf2ff76576c3ce65fcbb8 (patch)
tree59439be3e79516f7e83d2c9c15f59420cda314f3 /test
parent838d695c1652913ab5806ed677eab9b90b92becc (diff)
Prefer more descriptive assertion methods
Diffstat (limited to 'test')
-rw-r--r--test/pathname/test_pathname.rb22
1 files changed, 11 insertions, 11 deletions
diff --git a/test/pathname/test_pathname.rb b/test/pathname/test_pathname.rb
index 2ce32a6c12..77958b6359 100644
--- a/test/pathname/test_pathname.rb
+++ b/test/pathname/test_pathname.rb
@@ -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