Skip to content

Commit 4c1a8af

Browse files
committed
fix(ruby): Add more RSpec test methods
Add missing RSpec test methods like `its`, `specify`, `example`, `feature`, `scenario`. Also, add support for focused methods like `fdescribe`, `fit` and so on.
1 parent a7f9a27 commit 4c1a8af

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

languages/ruby/outline.scm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
(program
144144
(call
145145
method: (identifier) @_run @name
146-
(#any-of? @_run "describe" "context" "test" "it" "shared_examples")
146+
(#any-of? @_run "describe" "context" "test" "it" "its" "specify" "example" "feature" "scenario" "shared_examples" "fdescribe" "fcontext" "fit" "fexample" "focus" "xdescribe" "xcontext" "xit" "xexample" "xspecify" "skip" "pending" "it_behaves_like" "it_should_behave_like" "include_context" "include_examples")
147147
arguments: (argument_list
148148
.
149149
[
@@ -163,7 +163,7 @@
163163
; Nested test methods
164164
(call
165165
method: (identifier) @_ctx
166-
(#any-of? @_ctx "describe" "context" "shared_examples")
166+
(#any-of? @_ctx "describe" "context" "shared_examples" "fdescribe" "fcontext" "xdescribe" "xcontext")
167167
arguments: (argument_list
168168
.
169169
[
@@ -176,7 +176,7 @@
176176
(_
177177
(call
178178
method: (identifier) @_run @name
179-
(#any-of? @_run "describe" "context" "test" "it" "shared_examples")
179+
(#any-of? @_run "describe" "context" "test" "it" "its" "specify" "example" "feature" "scenario" "shared_examples" "fdescribe" "fcontext" "fit" "fexample" "focus" "xdescribe" "xcontext" "xit" "xexample" "xspecify" "skip" "pending" "it_behaves_like" "it_should_behave_like" "include_context" "include_examples")
180180
arguments: (argument_list
181181
.
182182
[
@@ -196,7 +196,7 @@
196196
; RSpec one-liners
197197
(call
198198
method: (identifier) @_ctx
199-
(#any-of? @_ctx "describe" "context" "shared_examples")
199+
(#any-of? @_ctx "describe" "context" "shared_examples" "fdescribe" "fcontext" "xdescribe" "xcontext")
200200
arguments: (argument_list
201201
.
202202
[
@@ -209,7 +209,7 @@
209209
(_
210210
(call
211211
method: (identifier) @_run @name
212-
(#any-of? @_run "it")
212+
(#any-of? @_run "it" "its" "specify" "example" "fit" "fexample" "focus" "xit" "xexample" "xspecify" "skip" "pending")
213213
block: (block
214214
body: (block_body
215215
(call

languages/ruby/runnables.scm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
; Examples
3939
((call
4040
method: (identifier) @run
41-
(#any-of? @run "describe" "context" "it" "its" "specify" "feature" "scenario")
41+
(#any-of? @run "describe" "context" "it" "its" "specify" "example" "feature" "scenario" "fdescribe" "fcontext" "fit" "fexample" "focus" "it_behaves_like" "it_should_behave_like" "include_context" "include_examples")
4242
arguments: (argument_list
4343
.
4444
(_) @name @RUBY_TEST_NAME)) @_ruby-test
@@ -47,7 +47,7 @@
4747
; Examples (one-liner syntax)
4848
((call
4949
method: (identifier) @run
50-
(#any-of? @run "it" "its" "specify")
50+
(#any-of? @run "it" "its" "specify" "example" "fit" "fexample" "focus")
5151
block: (_) @name @RUBY_TEST_NAME
5252
!arguments) @_ruby-test
5353
(#set! tag ruby-test))

0 commit comments

Comments
 (0)