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

test_tempfile.rb: use assert_predicate

* test/test_tempfile.rb: use assert_predicate and
  assert_not_predicate for better failure messages.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-05-31 04:45:10 +00:00
parent 56ef54338b
commit 33604da3f6

View file

@ -112,16 +112,16 @@ class TestTempfile < Test::Unit::TestCase
def test_close_and_close_p
t = tempfile("foo")
assert !t.closed?
assert_not_predicate(t, :closed?)
t.close
assert t.closed?
assert_predicate(t, :closed?)
end
def test_close_with_unlink_now_true_works
t = tempfile("foo")
path = t.path
t.close(true)
assert t.closed?
assert_predicate(t, :closed?)
assert_nil t.path
assert_file.not_exist?(path)
end
@ -143,7 +143,7 @@ class TestTempfile < Test::Unit::TestCase
t = tempfile("foo")
path = t.path
t.close!
assert t.closed?
assert_predicate(t, :closed?)
assert_nil t.path
assert_file.not_exist?(path)
end