File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -2499,6 +2499,28 @@ def blah()
24992499 assert_equal markup_code , expected
25002500 end
25012501
2502+ def test_parse_statements_method_oneliner_with_regexp
2503+ util_parser <<RUBY
2504+ class Foo
2505+ def blah() /bar/ end
2506+ end
2507+ RUBY
2508+
2509+ expected = <<EXPTECTED
2510+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">blah</span>() <span class="ruby-regexp">/bar/</span> <span class="ruby-keyword">end</span>
2511+ EXPTECTED
2512+ expected = expected . rstrip
2513+
2514+ @parser . scan
2515+
2516+ foo = @top_level . classes . first
2517+ assert_equal 'Foo' , foo . full_name
2518+
2519+ blah = foo . method_list . first
2520+ markup_code = blah . markup_code . sub ( /^.*\n / , '' )
2521+ assert_equal expected , markup_code
2522+ end
2523+
25022524 def test_parse_require_dynamic_string
25032525 content = <<-RUBY
25042526prefix = 'path'
You can’t perform that action at this time.
0 commit comments