mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Import RDoc 2.2.1 r185
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
00b4a3f9c4
commit
858362e761
54 changed files with 2893 additions and 2268 deletions
|
@ -10,7 +10,7 @@ class RDoc::Parser::C
|
|||
public :do_classes, :do_constants
|
||||
end
|
||||
|
||||
class TestRdocParserC < Test::Unit::TestCase
|
||||
class TestRDocParserC < Test::Unit::TestCase
|
||||
|
||||
def setup
|
||||
@tempfile = Tempfile.new self.class.name
|
||||
|
@ -244,9 +244,36 @@ Init_Foo(void) {
|
|||
assert_equal " \n a comment for class Foo on Init\n \n", klass.comment
|
||||
end
|
||||
|
||||
def test_define_method
|
||||
content = <<-EOF
|
||||
/*Method Comment! */
|
||||
static VALUE
|
||||
rb_io_s_read(argc, argv, io)
|
||||
int argc;
|
||||
VALUE *argv;
|
||||
VALUE io;
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
Init_IO(void) {
|
||||
/*
|
||||
* a comment for class Foo on rb_define_class
|
||||
*/
|
||||
VALUE rb_cIO = rb_define_class("IO", rb_cObject);
|
||||
rb_define_singleton_method(rb_cIO, "read", rb_io_s_read, -1);
|
||||
}
|
||||
EOF
|
||||
|
||||
klass = util_get_class content, 'rb_cIO'
|
||||
read_method = klass.method_list.first
|
||||
assert_equal "read", read_method.name
|
||||
assert_equal " Method Comment! \n", read_method.comment
|
||||
end
|
||||
|
||||
def util_get_class(content, name)
|
||||
parser = util_parser content
|
||||
parser.do_classes
|
||||
parser.scan
|
||||
parser.classes[name]
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue