* test/logger/test_logdevice.rb: Fix tests of logger to make it work on
windows (windows can not remove opened file) [Bug #11702] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52628 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3b91ff89da
commit
9876377040
@ -1,3 +1,8 @@
|
||||
Wed Nov 18 09:50:21 2015 Naotoshi Seo <sonots@gmail.com>
|
||||
|
||||
* test/logger/test_logdevice.rb: Fix tests of logger to make it work on
|
||||
windows (windows can not remove opened file) [Bug #11702]
|
||||
|
||||
Wed Nov 18 06:59:52 2015 Eric Wong <e@80x24.org>
|
||||
|
||||
* ext/socket/ancdata.c (bsock_recvmsg_internal): grow buffer
|
||||
|
@ -131,7 +131,7 @@ class TestLogDevice < Test::Unit::TestCase
|
||||
def test_reopen_file
|
||||
logdev = d(@filename)
|
||||
old_dev = logdev.dev
|
||||
File.unlink(@filename) if File.exist?(@filename) # remove once, then reopen
|
||||
|
||||
logdev.reopen
|
||||
begin
|
||||
assert(File.exist?(@filename))
|
||||
@ -154,14 +154,20 @@ class TestLogDevice < Test::Unit::TestCase
|
||||
def test_reopen_file_by_file
|
||||
logdev = d(@filename)
|
||||
old_dev = logdev.dev
|
||||
File.unlink(@filename) if File.exist?(@filename) # remove once, then reopen
|
||||
logdev.reopen(@filename)
|
||||
|
||||
tempfile2 = Tempfile.new("logger")
|
||||
tempfile2.close
|
||||
filename2 = tempfile2.path
|
||||
File.unlink(filename2)
|
||||
|
||||
logdev.reopen(filename2)
|
||||
begin
|
||||
assert(File.exist?(@filename))
|
||||
assert_equal(@filename, logdev.filename)
|
||||
assert(File.exist?(filename2))
|
||||
assert_equal(filename2, logdev.filename)
|
||||
assert(old_dev.closed?)
|
||||
ensure
|
||||
logdev.close
|
||||
tempfile2.close(true)
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user