Permalink
Browse files

Remove leading space from examples. [bug]

Note this should fixed in TomParse instead.
  • Loading branch information...
1 parent 2be6950 commit 02eb40e1bf9b1eb5ef7ed8f298d27592aa20b6c5 @trans trans committed Jun 14, 2012
Showing with 6 additions and 5 deletions.
  1. +2 −1 lib/yard-tomdoc.rb
  2. +4 −4 test/unit/test_docstring.rb
View
@@ -31,7 +31,8 @@ def self.const_missing(name)
def self.yard_parse(yard, comment)
tomdoc = TomParse.parse(comment)
- tomdoc.examples.each {|ex| yard.create_tag(:example, "\n" + ex) }
+ # TODO: TomParse should make the `strip` unecessary
+ tomdoc.examples.each {|ex| yard.create_tag(:example, "\n" + ex.strip) }
# TODO: how to figure-out class of argument ?
tomdoc.arguments.each {|arg| yard.create_tag(:param, "#{arg.name} #{arg.description}") }
@@ -6,10 +6,10 @@
describe YARD::Docstring do
make_docstring = Proc.new do |comment|
- if YARD::VERSION < '0.8'
- YARD::Docstring.new(comment)
- else
+ if YARD::VERSION == '0.8.0'
YARD::DocstringParser.new.parse(comment, self).to_docstring
+ else
+ YARD::Docstring.new(comment)
end
end
@@ -45,7 +45,7 @@
it "should fill examples tags" do
@docstring.tags(:example).size.assert == 1
- @docstring.tag(:example).text.assert == "multiplex('Tom', 4)\n # => 'TomTomTomTom'"
+ @docstring.tag(:example).text.assert == "multiplex('Tom', 4)\n# => 'TomTomTomTom'"
end
it "should fill return tag" do

0 comments on commit 02eb40e

Please sign in to comment.