lib/rubocop/cop/rspec/predicate_matcher.rb in rubocop-rspec-2.2.0 vs lib/rubocop/cop/rspec/predicate_matcher.rb in rubocop-rspec-2.3.0
- old
+ new
@@ -23,23 +23,26 @@
rewrite_matcher(corrector, predicate, matcher)
end
end
end
+ # @!method predicate_in_actual?(node)
def_node_matcher :predicate_in_actual?, <<-PATTERN
(send
(send nil? :expect {
(block $(send !nil? #predicate? ...) ...)
$(send !nil? #predicate? ...)})
$#Runners.all
$#boolean_matcher?)
PATTERN
+ # @!method be_bool?(node)
def_node_matcher :be_bool?, <<-PATTERN
(send nil? {:be :eq :eql :equal} {true false})
PATTERN
+ # @!method be_boolthy?(node)
def_node_matcher :be_boolthy?, <<-PATTERN
(send nil? {:be_truthy :be_falsey :be_falsy :a_truthy_value :a_falsey_value :a_falsy_value})
PATTERN
def boolean_matcher?(node)
@@ -150,17 +153,19 @@
corrector_explicit(corrector, node, actual, matcher, matcher)
end
end
end
+ # @!method predicate_matcher?(node)
def_node_matcher :predicate_matcher?, <<-PATTERN
(send
(send nil? :expect $!nil?)
#Runners.all
{$(send nil? #predicate_matcher_name? ...)
(block $(send nil? #predicate_matcher_name? ...) ...)})
PATTERN
+ # @!method predicate_matcher_block?(node)
def_node_matcher :predicate_matcher_block?, <<-PATTERN
(block
(send
(send nil? :expect $!nil?)
#Runners.all