mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/rdoc.rb: Import RDoc 3.7 release candidate
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
97ac172d58
commit
b7528b5edb
58 changed files with 2637 additions and 277 deletions
|
@ -1084,6 +1084,26 @@ EOF
|
|||
assert_equal top_bar, bar.find_module_named('A')
|
||||
end
|
||||
|
||||
def test_parse_include
|
||||
klass = RDoc::NormalClass.new 'C'
|
||||
klass.parent = @top_level
|
||||
|
||||
comment = "# my include\n"
|
||||
|
||||
util_parser "include I"
|
||||
|
||||
@parser.get_tk # include
|
||||
|
||||
@parser.parse_include klass, comment
|
||||
|
||||
assert_equal 1, klass.includes.length
|
||||
|
||||
incl = klass.includes.first
|
||||
assert_equal 'I', incl.name
|
||||
assert_equal 'my include', incl.comment
|
||||
assert_equal @top_level, incl.file
|
||||
end
|
||||
|
||||
def test_parse_meta_method
|
||||
klass = RDoc::NormalClass.new 'Foo'
|
||||
klass.parent = @top_level
|
||||
|
@ -2028,6 +2048,33 @@ end
|
|||
assert_equal 'm comment', m.comment
|
||||
end
|
||||
|
||||
def test_scan_block_comment_nested # Issue #41
|
||||
content = <<-CONTENT
|
||||
require 'something'
|
||||
=begin rdoc
|
||||
findmeindoc
|
||||
=end
|
||||
module Foo
|
||||
class Bar
|
||||
end
|
||||
end
|
||||
CONTENT
|
||||
|
||||
util_parser content
|
||||
|
||||
@parser.scan
|
||||
|
||||
foo = @top_level.modules.first
|
||||
|
||||
assert_equal 'Foo', foo.full_name
|
||||
assert_equal 'findmeindoc', foo.comment
|
||||
|
||||
bar = foo.classes.first
|
||||
|
||||
assert_equal 'Foo::Bar', bar.full_name
|
||||
assert_equal '', bar.comment
|
||||
end
|
||||
|
||||
def test_scan_block_comment_notflush
|
||||
##
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue