File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
templates/default/tags/html Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -49,4 +49,16 @@ module Foo; end
49
49
. not_to raise_error
50
50
end
51
51
end
52
+
53
+ describe "option tags on non-methods" do
54
+ it "does not display @option tags on non-method objects" do
55
+ YARD . parse_string <<-'eof'
56
+ # @option opts name [#to_s] ('bar') the name
57
+ module Foo; end
58
+ eof
59
+
60
+ expect { Registry . at ( 'Foo' ) . format ( html_options ) }
61
+ . not_to raise_error
62
+ end
63
+ end
52
64
end
Original file line number Diff line number Diff line change 1
- <% if object.has_tag?(:option) %>
1
+ <% if object.has_tag?(:option) && object.respond_to?(:parameters) %>
2
2
<% object.parameters.each do |param, default| %>
3
3
<% tags = object.tags(:option).select {|x| x.name.to_s == param.to_s.sub(/^\*+|:$/, '') } %>
4
4
<% next if tags.empty? %>
You can’t perform that action at this time.
0 commit comments