diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-09-28 14:45:44 +0900 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2020-09-18 14:57:58 +0900 |
commit | e23f0f29daa45f69ef78b174340c747ac09bfb60 (patch) | |
tree | dd5191d06314d6812f3a4eb0b3a4777f63adee64 /test/rdoc | |
parent | b5db9b8a314249adee021ba6a426c6a2ebbc6804 (diff) |
[ruby/rdoc] update all files if any file is newer
Cross references need parse all files which define the subject
names. This commit makes `--force-update` option enforce to parse
all files if any file is newer than the previous parse, not only
updated files.
https://github.com/ruby/rdoc/commit/13e9a44896
Diffstat (limited to 'test/rdoc')
-rw-r--r-- | test/rdoc/test_rdoc_rdoc.rb | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/test/rdoc/test_rdoc_rdoc.rb b/test/rdoc/test_rdoc_rdoc.rb index f2cc901283..f7d9b8659f 100644 --- a/test/rdoc/test_rdoc_rdoc.rb +++ b/test/rdoc/test_rdoc_rdoc.rb @@ -73,6 +73,11 @@ class TestRDocRDoc < RDoc::TestCase b = File.expand_path '../test_rdoc_text.rb', __FILE__ assert_equal [a, b], @rdoc.gather_files([b, a, b]) + + assert_empty @rdoc.gather_files([b, a, b]) + + @rdoc.last_modified[a] -= 10 + assert_equal [a, b], @rdoc.gather_files([b, a, b]) end def test_handle_pipe @@ -146,7 +151,7 @@ class TestRDocRDoc < RDoc::TestCase @rdoc.normalized_file_list [test_path, flag_file] end - files = files.map { |file| File.expand_path file } + files = files.map { |file, *| File.expand_path file } assert_equal [test_path], files end @@ -156,7 +161,9 @@ class TestRDocRDoc < RDoc::TestCase files = @rdoc.normalized_file_list [__FILE__] - assert_empty files + files = files.collect {|file, mtime| file if mtime}.compact + + assert_empty(files) end def test_normalized_file_list_non_file_directory @@ -205,7 +212,7 @@ class TestRDocRDoc < RDoc::TestCase @rdoc.normalized_file_list [File.realpath(dir)] end - files = files.map { |file| File.expand_path file } + files = files.map { |file, *| File.expand_path file } assert_equal expected_files, files end @@ -236,7 +243,7 @@ class TestRDocRDoc < RDoc::TestCase @rdoc.normalized_file_list [File.realpath(dir)] end - files = files.map { |file| File.expand_path file } + files = files.map { |file, *| File.expand_path file } assert_equal expected_files, files end |