Permalink
Browse files

Added aliases to the report

  • Loading branch information...
1 parent b190f13 commit 893166543eb3bcc1f4279661734a52bee79976b1 @drbrain drbrain committed Apr 6, 2012
Showing with 31 additions and 3 deletions.
  1. +8 −3 lib/rdoc/generator/spellcheck.rb
  2. +23 −0 test/test_rdoc_generator_spellcheck.rb
@@ -110,10 +110,15 @@ def generate files
end
mod.each_method do |meth|
- comment = meth.comment
- location = meth.file
+ report.concat misspellings_for(meth.full_name, meth.comment, meth.file)
+ end
+
+ aliases = mod.aliases + mod.external_aliases
+
+ aliases.each do |alas|
+ name = "Object alias #{alas.old_name} #{alas.new_name}"
- report.concat misspellings_for(meth.full_name, comment, location)
+ report.concat misspellings_for(name, alas.comment, alas.file)
end
end
@@ -70,6 +70,29 @@ def test_generate
assert_match %r%^"gud"%, out
end
+ def test_generate_alias
+ klass = @top_level.add_class RDoc::NormalClass, 'Object'
+
+ meth = RDoc::AnyMethod.new nil, 'new'
+ meth.comment = comment ''
+ meth.record_location @top_level
+
+ klass.add_method meth
+ alas = RDoc::Alias.new nil, 'old', 'new', comment(@text)
+ alas.record_location @top_level
+
+ klass.add_alias alas
+
+ out, err = capture_io do
+ @sc.generate [@top_level]
+ end
+
+ assert_empty err
+
+ assert_match %r%^Object alias old new in file\.rb:%, out
+ assert_match %r%^"gud"%, out
+ end
+
def test_generate_attribute
klass = @top_level.add_class RDoc::NormalClass, 'Object'

0 comments on commit 8931665

Please sign in to comment.