lib/rubocop/rspec/language.rb in rubocop-rspec-1.42.0 vs lib/rubocop/rspec/language.rb in rubocop-rspec-1.43.0
- old
+ new
@@ -2,12 +2,10 @@
module RuboCop
module RSpec
# RSpec public API methods that are commonly used in cops
module Language
- RSPEC = '{(const {nil? cbase} :RSpec) nil?}'
-
# Set of method selectors
class SelectorSet
def initialize(selectors)
@selectors = selectors
end
@@ -27,18 +25,22 @@
def block_pattern
"(block #{send_pattern} ...)"
end
def block_pass_pattern
- "(send #{RSPEC} #{node_pattern_union} _ block_pass)"
+ "(send #rspec? #{node_pattern_union} _ block_pass)"
end
def block_or_block_pass_pattern
"{#{block_pattern} #{block_pass_pattern}}"
end
def send_pattern
- "(send #{RSPEC} #{node_pattern_union} ...)"
+ "(send #rspec? #{node_pattern_union} ...)"
+ end
+
+ def send_or_block_or_block_pass_pattern
+ "{#{send_pattern} #{block_pattern} #{block_pass_pattern}}"
end
def node_pattern_union
"{#{node_pattern}}"
end