From c8770078a17a28e70e7b73c4220e08095c5659c7 Mon Sep 17 00:00:00 2001 From: Vitaly Slobodin Date: Wed, 21 May 2025 22:28:58 +0200 Subject: [PATCH] Add `@RUBY_TEST_NAME` capture for test nodes Reordered and added @RUBY_TEST_NAME capture to test method arguments and blocks to provide explicit test name references for: - test method with string argument - describe/context/it/its/specify methods with arguments - it/its/specify methods with blocks without arguments --- languages/ruby/runnables.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/languages/ruby/runnables.scm b/languages/ruby/runnables.scm index e45624f..c58344a 100644 --- a/languages/ruby/runnables.scm +++ b/languages/ruby/runnables.scm @@ -17,8 +17,8 @@ ( (call method: (identifier) @run (#eq? @run "test") - arguments: (argument_list (string (string_content) @name)) ) @_ruby-test + arguments: (argument_list (string (string_content) @name @RUBY_TEST_NAME)) (#set! tag ruby-test) ) @@ -42,8 +42,8 @@ ( (call method: (identifier) @run (#any-of? @run "describe" "context" "it" "its" "specify") - arguments: (argument_list . (_) @name) ) @_ruby-test + arguments: (argument_list . (_) @name @RUBY_TEST_NAME) (#set! tag ruby-test) ) @@ -51,7 +51,7 @@ ( (call method: (identifier) @run (#any-of? @run "it" "its" "specify") - block: (_) @name + block: (_) @name @RUBY_TEST_NAME !arguments ) @_ruby-test (#set! tag ruby-test)