diff options
author | Nobuyoshi Nakada <[email protected]> | 2021-01-23 00:20:53 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2021-01-24 16:46:25 +0900 |
commit | d5d1c41728d65acfb8aa2cf95f2d8ac88f271cd1 (patch) | |
tree | 017a1ce98bf1b8f9aff3bf258aa1f2c9a9ac9061 /test/rdoc/test_rdoc_parser_changelog.rb | |
parent | fa048a0f8523cefde5428805dd334691486319e6 (diff) |
[ruby/rdoc] Sort by CommitDate if available
https://github.com/ruby/rdoc/commit/455715e930
Diffstat (limited to 'test/rdoc/test_rdoc_parser_changelog.rb')
-rw-r--r-- | test/rdoc/test_rdoc_parser_changelog.rb | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/test/rdoc/test_rdoc_parser_changelog.rb b/test/rdoc/test_rdoc_parser_changelog.rb index fd19566064..6a14b61ca2 100644 --- a/test/rdoc/test_rdoc_parser_changelog.rb +++ b/test/rdoc/test_rdoc_parser_changelog.rb @@ -398,6 +398,46 @@ ChangeLog assert_equal expected, @top_level.comment end + def test_scan_git_commit_date + parser = util_parser <<-ChangeLog +commit\ ee1e690a2df901adb279d7a63fbd92c64e0a5ae6 + Author: Igor Zubkov <[email protected]> + AuthorDate: 2016-10-25 03:56:11 +0900 + Commit: Nobuyoshi Nakada <[email protected]> + CommitDate: 2021-01-07 13:40:42 +0900 + + We don't need "require 'uri'" after "require 'net/http'". + +commit\ 4d0985a7bd8f591dff4b430e288bfd83af782e51 + Author: git <[email protected]> + AuthorDate: 2021-01-07 10:21:34 +0900 + Commit: git <[email protected]> + CommitDate: 2021-01-07 10:21:34 +0900 + + * 2021-01-07 [ci skip] +ChangeLog + + parser.scan + + expected = doc( + head(1, File.basename(@tempfile.path)), + blank_line, + head(2, "2021-01-07"), + blank_line, + log_entry(nil, 'ee1e690a2df901adb279', + 'Igor Zubkov', '[email protected]', + '2016-10-25 03:56:11 +0900', + [head(4, %[We don't need "require 'uri'" after "require 'net/http'".])]), + log_entry(nil, '4d0985a7bd8f591dff4b', + 'git', '[email protected]', + '2021-01-07 10:21:34 +0900', + [list(:BULLET, item(nil, para("2021-01-07 [ci skip]")))])) + + expected.file = @top_level + + assert_equal expected, @top_level.comment + end + def util_parser content = '' RDoc::Parser::ChangeLog.new \ @top_level, @tempfile.path, content, @options, @stats |