diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-12-06 23:51:45 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-12-06 23:51:45 +0000 |
commit | 297303107d1efaaf43e80dc76abe65e742063241 (patch) | |
tree | 8ec622a0af732c0ba504e2b98ce9da22a34e260b /test/rdoc | |
parent | 33dab9cdc9dd9fcde94e3f85d7d287c18e4b585d (diff) | |
download | ruby-297303107d1efaaf43e80dc76abe65e742063241.tar.gz |
Dump more timestamps
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rdoc')
-rw-r--r-- | test/rdoc/test_rdoc_generator_json_index.rb | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/test/rdoc/test_rdoc_generator_json_index.rb b/test/rdoc/test_rdoc_generator_json_index.rb index b057832329..597dfb6b84 100644 --- a/test/rdoc/test_rdoc_generator_json_index.rb +++ b/test/rdoc/test_rdoc_generator_json_index.rb @@ -89,13 +89,6 @@ class TestRDocGeneratorJsonIndex < RDoc::TestCase 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::TestCase 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' |