File tree 5 files changed +8
-12
lines changed
5 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ class AroundBlock < Base
31
31
'or `%<arg>s.run`.'
32
32
33
33
def_node_matcher :hook , <<-PATTERN
34
- (block { (send nil? :around) (send nil? :around sym)} (args $...) ...)
34
+ (block (send nil? :around sym ?) (args $...) ...)
35
35
PATTERN
36
36
37
37
def_node_search :find_arg_usage , <<-PATTERN
Original file line number Diff line number Diff line change @@ -22,8 +22,7 @@ class ImplicitBlockExpectation < Base
22
22
def_node_matcher :lambda? , <<-PATTERN
23
23
{
24
24
(send (const nil? :Proc) :new)
25
- (send nil? :proc)
26
- (send nil? :lambda)
25
+ (send nil? {:proc :lambda})
27
26
}
28
27
PATTERN
29
28
Original file line number Diff line number Diff line change @@ -43,10 +43,10 @@ class SubjectStub < Base
43
43
#
44
44
# @yield [Symbol] subject name
45
45
def_node_matcher :subject , <<-PATTERN
46
- {
47
- (block (send nil? :subject (sym $_)) args ...)
48
- (block (send nil? $ :subject) args ...)
49
- }
46
+ (block
47
+ (send nil?
48
+ { :subject (sym $_) | $:subject}
49
+ ) args ...)
50
50
PATTERN
51
51
52
52
# @!method message_expectation?(node, method_name)
Original file line number Diff line number Diff line change @@ -6,11 +6,7 @@ module RSpec
6
6
class Hook < Concept
7
7
def_node_matcher :extract_metadata , <<~PATTERN
8
8
(block
9
- {
10
- (send _ _ #valid_scope? $...)
11
- (send _ _ $...)
12
- }
13
- ...
9
+ (send _ _ #valid_scope? ? $...) ...
14
10
)
15
11
PATTERN
16
12
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ Gem::Specification.new do |spec|
37
37
}
38
38
39
39
spec . add_runtime_dependency 'rubocop' , '~> 0.87'
40
+ spec . add_runtime_dependency 'rubocop-ast' , '~> 0.7.1'
40
41
41
42
spec . add_development_dependency 'rack'
42
43
spec . add_development_dependency 'rake'
You can’t perform that action at this time.
0 commit comments