Permalink
Browse files

Added attributes to the report

  • Loading branch information...
1 parent a3376b1 commit e55416f5ac79a1c071f8cb2efde527ee154a72f5 @drbrain drbrain committed Apr 6, 2012
Showing with 27 additions and 0 deletions.
  1. +9 −0 lib/rdoc/generator/spellcheck.rb
  2. +18 −0 test/test_rdoc_generator_spellcheck.rb
@@ -100,6 +100,15 @@ def generate files
report.concat misspellings_for(name, comment, location)
end
+ mod.each_attribute do |attr|
+ comment = attr.comment
+ location = attr.file
+
+ name = "#{attr.parent.full_name}.#{attr.definition} :#{attr.name}"
+
+ report.concat misspellings_for(name, comment, location)
+ end
+
mod.each_method do |method|
comment = method.comment
location = method.file
@@ -70,6 +70,24 @@ def test_generate
assert_match %r%^"gud"%, out
end
+ def test_generate_attribute
+ klass = @top_level.add_class RDoc::NormalClass, 'Object'
+
+ attribute = RDoc::Attr.new nil, 'attr', 'RW', comment(@text)
+ attribute.record_location @top_level
+
+ klass.add_attribute attribute
+
+ out, err = capture_io do
+ @sc.generate [@top_level]
+ end
+
+ assert_empty err
+
+ assert_match %r%^Object\.attr_accessor :attr in file\.rb:%, out
+ assert_match %r%^"gud"%, out
+ end
+
def test_generate_constant
klass = @top_level.add_class RDoc::NormalClass, 'Object'

0 comments on commit e55416f

Please sign in to comment.