mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/rdoc.rb: Updated to RDoc 3.6
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
fe89874540
commit
0b6da24a5e
28 changed files with 593 additions and 97 deletions
|
@ -1799,6 +1799,56 @@ EOF
|
|||
assert_equal :private, foo.visibility
|
||||
end
|
||||
|
||||
def test_parse_statements_identifier_public_class_method
|
||||
content = <<-CONTENT
|
||||
class Date
|
||||
def self.now; end
|
||||
private_class_method :now
|
||||
end
|
||||
|
||||
class DateTime < Date
|
||||
public_class_method :now
|
||||
end
|
||||
CONTENT
|
||||
|
||||
util_parser content
|
||||
|
||||
@parser.parse_statements @top_level
|
||||
|
||||
date, date_time = @top_level.classes
|
||||
|
||||
date_now = date.method_list.first
|
||||
date_time_now = date_time.method_list.first
|
||||
|
||||
assert_equal :private, date_now.visibility
|
||||
assert_equal :public, date_time_now.visibility
|
||||
end
|
||||
|
||||
def test_parse_statements_identifier_private_class_method
|
||||
content = <<-CONTENT
|
||||
class Date
|
||||
def self.now; end
|
||||
public_class_method :now
|
||||
end
|
||||
|
||||
class DateTime < Date
|
||||
private_class_method :now
|
||||
end
|
||||
CONTENT
|
||||
|
||||
util_parser content
|
||||
|
||||
@parser.parse_statements @top_level
|
||||
|
||||
date, date_time = @top_level.classes
|
||||
|
||||
date_now = date.method_list.first
|
||||
date_time_now = date_time.method_list.first
|
||||
|
||||
assert_equal :public, date_now.visibility, date_now.full_name
|
||||
assert_equal :private, date_time_now.visibility, date_time_now.full_name
|
||||
end
|
||||
|
||||
def test_parse_statements_identifier_require
|
||||
content = "require 'bar'"
|
||||
|
||||
|
@ -1978,6 +2028,53 @@ end
|
|||
assert_equal 'm comment', m.comment
|
||||
end
|
||||
|
||||
def test_scan_block_comment_notflush
|
||||
##
|
||||
#
|
||||
# The previous test assumes that between the =begin/=end blocs that there is
|
||||
# only one line, or minima formatting directives. This test tests for those
|
||||
# who use the =begin bloc with longer / more advanced formatting within.
|
||||
#
|
||||
##
|
||||
content = <<-CONTENT
|
||||
=begin rdoc
|
||||
|
||||
= DESCRIPTION
|
||||
|
||||
This is a simple test class
|
||||
|
||||
= RUMPUS
|
||||
|
||||
Is a silly word
|
||||
|
||||
=end
|
||||
class StevenSimpleClass
|
||||
# A band on my iPhone as I wrote this test
|
||||
FRUIT_BATS="Make nice music"
|
||||
|
||||
=begin rdoc
|
||||
A nice girl
|
||||
=end
|
||||
|
||||
def lauren
|
||||
puts "Summoning Lauren!"
|
||||
end
|
||||
end
|
||||
CONTENT
|
||||
util_parser content
|
||||
|
||||
@parser.scan
|
||||
|
||||
foo = @top_level.classes.first
|
||||
|
||||
assert_equal "= DESCRIPTION\n\nThis is a simple test class\n\n= RUMPUS\n\nIs a silly word",
|
||||
foo.comment
|
||||
|
||||
m = foo.method_list.first
|
||||
|
||||
assert_equal 'A nice girl', m.comment
|
||||
end
|
||||
|
||||
def test_scan_meta_method_block
|
||||
content = <<-CONTENT
|
||||
class C
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue