ruby-changes:54046
From: nobu <ko1@a...>
Date: Fri, 7 Dec 2018 08:51:50 +0900 (JST)
Subject: [ruby-changes:54046] nobu:r66265 (trunk): Dump more timestamps
nobu 2018-12-07 08:51:45 +0900 (Fri, 07 Dec 2018) New Revision: 66265 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66265 Log: Dump more timestamps Modified files: trunk/test/rdoc/test_rdoc_generator_json_index.rb Index: test/rdoc/test_rdoc_generator_json_index.rb =================================================================== --- test/rdoc/test_rdoc_generator_json_index.rb (revision 66264) +++ test/rdoc/test_rdoc_generator_json_index.rb (revision 66265) @@ -89,13 +89,6 @@ class TestRDocGeneratorJsonIndex < RDoc: https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_generator_json_index.rb#L89 end def test_generate - now = Time.now - @g.generate - - assert_file 'js/searcher.js' - assert_file 'js/navigation.js' - assert_file 'js/search_index.js' - srcdir = File.expand_path('lib/rdoc', @pwd) if !File.directory? srcdir # for Ruby core repository @@ -103,17 +96,28 @@ class TestRDocGeneratorJsonIndex < RDoc: https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_generator_json_index.rb#L96 end orig_file = Pathname(File.join srcdir, 'generator/template/json_index/js/navigation.js') + orig_time = orig_file.mtime + + now = Time.now + @g.generate + + assert_file 'js/searcher.js' + assert_file 'js/navigation.js' + assert_file 'js/search_index.js' + generated_file = Pathname(File.join @tmpdir, 'js/navigation.js') # This is dirty hack on JRuby for MiniTest 4 assert orig_file.mtime.inspect == generated_file.mtime.inspect, '.js files should be tha same timestamp of original' - assert generated_file.mtime < now, - ".js files should be the same timestamp,\n" + - "path: #{generated_file.inspect},\n" + - "time: #{generated_file.mtime.inspect},\n" + - "now : #{now.inspect}" + assert generated_file.mtime < now, proc {t = Time.now; <<~INSPECT} + .js files should be the same timestamp, + path : #{generated_file} + mtime: #{generated_file.mtime} + orig : #{orig_time} -> #{orig_file.mtime}, #{orig_file.mtime-orig_time} + now : #{now} -> #{t}, #{t-now} + INSPECT generated_search_index = Pathname(File.join @tmpdir, 'js/search_index.js') assert generated_search_index.mtime > (now - 1), 'search_index.js should be generated timestamp' -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/