ruby-changes:33020
From: nobu <ko1@a...>
Date: Sat, 22 Feb 2014 12:18:43 +0900 (JST)
Subject: [ruby-changes:33020] nobu:r45099 (trunk): test_logdevice.rb: no utime
nobu 2014-02-22 12:18:36 +0900 (Sat, 22 Feb 2014) New Revision: 45099 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45099 Log: test_logdevice.rb: no utime * test/logger/test_logdevice.rb (test_shifting_midnight): do not set mtime to get rid of an error on Windows. Modified files: trunk/test/logger/test_logdevice.rb Index: test/logger/test_logdevice.rb =================================================================== --- test/logger/test_logdevice.rb (revision 45098) +++ test/logger/test_logdevice.rb (revision 45099) @@ -346,7 +346,6 @@ class TestLogDevice < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/test/logger/test_logdevice.rb#L346 dev = Logger::LogDevice.new(log, shift_age: 'daily') dev.write("#{Time.now} hello-1\n") - File.utime(*[Time.mktime(2014, 1, 3, 0, 0, 0, 121000)]*2, log) Time.now = Time.mktime(2014, 1, 3, 1, 1, 1) dev.write("#{Time.now} hello-2\n") ensure @@ -356,7 +355,9 @@ class TestLogDevice < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/test/logger/test_logdevice.rb#L355 bug = '[GH-539]' log = File.join(tmpdir, "log") - assert_match(/hello-2/, File.read(log)) + cont = File.read(log) + assert_match(/hello-2/, cont) + assert_not_match(/hello-1/, cont) assert_file.for(bug).exist?(log+".20140102") assert_match(/hello-1/, File.read(log+".20140102"), bug) end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/