From 145d95d4554f39921a8a8fbdacffb43d26996b2f Mon Sep 17 00:00:00 2001 From: phiggins Date: Thu, 12 May 2011 23:55:30 -0700 Subject: [PATCH 1/2] Fix a typo. --- test/test_rdoc_parser_c.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_rdoc_parser_c.rb b/test/test_rdoc_parser_c.rb index 6a3a92001a..df34f2cb7a 100644 --- a/test/test_rdoc_parser_c.rb +++ b/test/test_rdoc_parser_c.rb @@ -680,7 +680,7 @@ def test_find_body_document_method baz = methods.last assert_equal 'Foo#baz', baz.full_name - assert_equal "a comment for bar", bar.comment + assert_equal "a comment for bar", baz.comment end def test_find_modifiers_call_seq From a7780af0216f4e7a94d5f7d4bee64752e9cf137d Mon Sep 17 00:00:00 2001 From: phiggins Date: Thu, 12 May 2011 23:58:06 -0700 Subject: [PATCH 2/2] Add failing test case for Rdoc::Parser::C. This was causing rdoc to miss documentation on some parts of ruby implemented in C, for example zlib.c and win32ole.c. --- test/test_rdoc_parser_c.rb | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/test/test_rdoc_parser_c.rb b/test/test_rdoc_parser_c.rb index df34f2cb7a..6457540759 100644 --- a/test/test_rdoc_parser_c.rb +++ b/test/test_rdoc_parser_c.rb @@ -911,6 +911,37 @@ def test_define_method { } +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! ", read_method.comment + assert_equal "rb_io_s_read", read_method.c_function + assert read_method.singleton + end + + def test_define_method_with_prototype + content = <<-EOF +static VALUE rb_io_s_read(int, VALUE*, VALUE); + +/*Method Comment! */ +static VALUE +rb_io_s_read(argc, argv, io) + int argc; + VALUE *argv; + VALUE io; +{ +} + void Init_IO(void) { /*