ruby-changes:31498
From: nobu <ko1@a...>
Date: Fri, 8 Nov 2013 03:11:42 +0900 (JST)
Subject: [ruby-changes:31498] nobu:r43577 (trunk): test_logger.rb: clear garbage files
nobu 2013-11-08 03:11:38 +0900 (Fri, 08 Nov 2013) New Revision: 43577 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43577 Log: test_logger.rb: clear garbage files * test/logger/test_logger.rb (test_shifting_age_in_multiprocess): unlink rotated log files all. Modified files: trunk/test/logger/test_logger.rb Index: test/logger/test_logger.rb =================================================================== --- test/logger/test_logger.rb (revision 43576) +++ test/logger/test_logger.rb (revision 43577) @@ -506,9 +506,6 @@ class TestLogDevice < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/test/logger/test_logger.rb#L506 def test_shifting_age_in_multiprocess yyyymmdd = Time.now.strftime("%Y%m%d") - filename1 = @filename + ".#{yyyymmdd}" - filename2 = @filename + ".#{yyyymmdd}.1" - filename3 = @filename + ".#{yyyymmdd}.2" begin stderr = run_children(2, [@filename], <<-'END') logger = Logger.new(ARGV[0], 'now') @@ -520,7 +517,7 @@ class TestLogDevice < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/test/logger/test_logger.rb#L517 assert_no_match(/log writing failed/, stderr) assert_no_match(/log rotation inter-process lock failed/, stderr) ensure - [filename1, filename2, filename3].each do |filename| + Dir.glob("#{@filename}.#{yyyymmdd}{,.[1-9]*}") do |filename| File.unlink(filename) if File.exist?(filename) end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/