diff --git a/lib/rdoc/known_classes.rb b/lib/rdoc/known_classes.rb index bdda96ae0e..3e8752bbde 100644 --- a/lib/rdoc/known_classes.rb +++ b/lib/rdoc/known_classes.rb @@ -46,8 +46,8 @@ module RDoc "rb_eInterrupt" => "Interrupt", "rb_eLoadError" => "LoadError", "rb_eNameError" => "NameError", - "rb_eNoMemError" => "NoMemError", - "rb_eNotImpError" => "NotImpError", + "rb_eNoMemError" => "NoMemoryError", + "rb_eNotImpError" => "NotImplementedError", "rb_eRangeError" => "RangeError", "rb_eRuntimeError" => "RuntimeError", "rb_eScriptError" => "ScriptError", @@ -58,7 +58,7 @@ module RDoc "rb_eSystemCallError" => "SystemCallError", "rb_eSystemExit" => "SystemExit", "rb_eTypeError" => "TypeError", - "rb_eZeroDivError" => "ZeroDivError", + "rb_eZeroDivError" => "ZeroDivisionError", "rb_mComparable" => "Comparable", "rb_mEnumerable" => "Enumerable", diff --git a/test/rdoc/test_rdoc_parser_c.rb b/test/rdoc/test_rdoc_parser_c.rb index 8125f5def6..4bb18ce925 100644 --- a/test/rdoc/test_rdoc_parser_c.rb +++ b/test/rdoc/test_rdoc_parser_c.rb @@ -101,6 +101,29 @@ class TestRDocParserC < RDoc::TestCase end end + def test_known_classes + RDoc::KNOWN_CLASSES.each do |var, name| + case name + when "Refinement" + next unless defined?(Refinement) + when "Bignum", "Fixnum", "Data", "Socket", /\A(?![A-Z])/ + next + end + obj = Object.const_get(name) + assert_equal obj.name, name + case var + when /\Arb_c/ + assert_kind_of Class, obj + when /\Arb_m/ + assert_kind_of Module, obj + when /\Arb_e/ + assert_operator obj, :<=, Exception + else + raise "unknown prefix: #{var} => #{name}" + end + end + end + def test_initialize some_ext = @top_level.add_class RDoc::NormalClass, 'SomeExt' @top_level.add_class RDoc::SingleClass, 'SomeExtSingle' @@ -115,8 +138,6 @@ class TestRDocParserC < RDoc::TestCase parser = RDoc::Parser::C.new @top_level, @fn, '', @options, @stats - assert_equal "ArgumentError", parser.known_classes["rb_eArgError"] - expected = { 'cSomeExt' => some_ext } assert_equal expected, parser.classes