ruby-changes:42567
From: sonots <ko1@a...>
Date: Mon, 18 Apr 2016 23:58:08 +0900 (JST)
Subject: [ruby-changes:42567] sonots:r54641 (trunk): * test/logger/test_logdevice.rb: fix tests to pass on windows
sonots 2016-04-19 00:54:45 +0900 (Tue, 19 Apr 2016) New Revision: 54641 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54641 Log: * test/logger/test_logdevice.rb: fix tests to pass on windows Modified files: trunk/test/logger/test_logdevice.rb Index: test/logger/test_logdevice.rb =================================================================== --- test/logger/test_logdevice.rb (revision 54640) +++ test/logger/test_logdevice.rb (revision 54641) @@ -295,10 +295,12 @@ class TestLogDevice < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/test/logger/test_logdevice.rb#L295 def test_shifting_period_suffix # shift_age other than 'daily', 'weekly', and 'monthly' means 'everytime' - { - "%Y%m%d" => Logger.new(@filename, 'now', 1048576), # default - "%Y-%m-%d" => Logger.new(@filename, 'now', 1048576, shift_period_suffix: '%Y-%m-%d') - }.each do |format, logger| + ['%Y%m%d', '%Y-%m-%d', '%Y'].each do |format| + if format == '%Y%m%d' # default + logger = Logger.new(@filename, 'now', 1048576) + else # config + logger = Logger.new(@filename, 'now', 1048576, shift_period_suffix: format) + end begin yyyymmdd = Time.now.strftime(format) filename1 = @filename + ".#{yyyymmdd}" -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/