Skip to content

Commit 6bd9fa6

Browse files
committed
Add test_document_after_rescue_inside_paren
1 parent b612856 commit 6bd9fa6

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/test_rdoc_parser_ruby.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3573,6 +3573,25 @@ class C
35733573
assert_equal :public, const_c.visibility
35743574
end
35753575

3576+
def test_document_after_rescue_inside_paren
3577+
util_parser <<-RUBY
3578+
class C
3579+
attr_accessor :sample if (1.inexistent_method rescue false)
3580+
# first
3581+
# second
3582+
def a
3583+
end
3584+
end
3585+
RUBY
3586+
3587+
@parser.scan
3588+
3589+
c = @store.find_class_named 'C'
3590+
3591+
c_a = c.find_method_named 'a'
3592+
assert_equal "first\nsecond", c_a.comment.text
3593+
end
3594+
35763595
def test_singleton_method_via_eigenclass
35773596
util_parser <<-RUBY
35783597
class C

0 commit comments

Comments
 (0)