Skip to content

Commit 0b4b7d8

Browse files
authored
fix(ruby): fix runnable detection (#234)
In #229 , we changed the runnable detection logic for it, describe, its, etc. to look inside of strings for their content so that we don't pass along their quotations to the command line. However, in doing so, tests that use modules, classes, or symbols were no longer being detected. Add back detection for those, and a catch-all to make sure we don't miss any other cases (which is what we had before).
1 parent 5d93340 commit 0b4b7d8

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

languages/ruby/runnables.scm

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,15 @@
4444
"include_examples")
4545
arguments: (argument_list
4646
.
47-
(_
48-
(string_content) @name @RUBY_TEST_NAME))) @_ruby-test
47+
[
48+
(_
49+
(string_content) @name @RUBY_TEST_NAME)
50+
(constant) @name @RUBY_TEST_NAME
51+
(scope_resolution) @name @RUBY_TEST_NAME
52+
(simple_symbol) @name @RUBY_TEST_NAME
53+
; Catch-all to make sure we don't miss any cases (numbers, arrays, dynamically generated names, etc)
54+
(_) @name @RUBY_TEST_NAME
55+
])) @_ruby-test
4956
(#set! tag ruby-test))
5057

5158
; Examples (one-liner syntax)

0 commit comments

Comments
 (0)