Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added methods to the report

  • Loading branch information...
commit 153db82a8d74ffd8cab9fa4fa0fe0d13f5aab2db 1 parent cd9b2b4
@drbrain drbrain authored
View
8 lib/rdoc/generator/spellcheck.rb
@@ -88,6 +88,13 @@ def generate files
mod.comment_location.each do |comment, location|
report.concat misspellings_for(mod.definition, comment, location)
end
+
+ mod.each_method do |method|
+ comment = method.comment
+ location = method.file
+
+ report.concat misspellings_for(method.full_name, comment, location)
+ end
end
if @misspellings.zero? then
@@ -95,7 +102,6 @@ def generate files
else
puts report.join "\n"
end
-
end
##
View
19 test/test_rdoc_generator_spellcheck.rb
@@ -84,6 +84,25 @@ def test_generate_correct
assert_equal "No misspellings found\n", out
end
+ def test_generate_method
+ klass = @top_level.add_class RDoc::NormalClass, 'Object'
+
+ meth = RDoc::AnyMethod.new nil, 'method'
+ meth.record_location @top_level
+ meth.comment = comment @text, meth
+
+ klass.add_method meth
+
+ out, err = capture_io do
+ @sc.generate [@top_level]
+ end
+
+ assert_empty err
+
+ assert_match %r%^Object#method in file\.rb:%, out
+ assert_match %r%^"gud"%, out
+ end
+
def test_misspellings_for
out = @sc.misspellings_for 'class Object', comment(@text), @top_level
Please sign in to comment.
Something went wrong with that request. Please try again.