Skip to content

Commit

Permalink
Don't copy reftags twice
Browse files Browse the repository at this point in the history
Fixes #678
  • Loading branch information
lsegal committed Jul 26, 2013
1 parent 8fda62b commit 1acde11
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 0 additions & 2 deletions lib/yard/docstring.rb
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,7 @@ def resolve_reference
return if CodeObjects::Proxy === @unresolved_reference

reference, @unresolved_reference = @unresolved_reference, nil
resolved_tags = reference.docstring.tags
self.all = [reference.docstring.all, @all].join("\n")
add_tag(*resolved_tags)
end
end

Expand Down
7 changes: 6 additions & 1 deletion spec/docstring_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -318,12 +318,17 @@
YARD.parse_string <<-eof
class A
# Docstring
# @return [Boolean]
def a; end
# (see #a)
def b; end
end
eof
YARD::Registry.at('A#b').docstring.should == 'Docstring'

object = YARD::Registry.at('A#b')
object.docstring.should == 'Docstring'
object.tags.map {|x| x.tag_name }.should == ['return']

YARD::Registry.clear
end
end
Expand Down

0 comments on commit 1acde11

Please sign in to comment.