lib/rubocop/cop/rspec/predicate_matcher.rb in rubocop-rspec-2.25.0 vs lib/rubocop/cop/rspec/predicate_matcher.rb in rubocop-rspec-2.26.0

- old
+ new

@@ -24,26 +24,26 @@ end end end # @!method predicate_in_actual?(node) - def_node_matcher :predicate_in_actual?, <<-PATTERN + 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 + 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 + 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) if cop_config['Strict'] @@ -177,20 +177,20 @@ %i[str dstr xstr].include?(arg.type) end.any?(&:heredoc?) end # @!method predicate_matcher?(node) - def_node_matcher :predicate_matcher?, <<-PATTERN + 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 + def_node_matcher :predicate_matcher_block?, <<~PATTERN (block (send (send nil? :expect $!nil?) #Runners.all $(send nil? #predicate_matcher_name?)) @@ -200,10 +200,10 @@ def predicate_matcher_name?(name) name = name.to_s return false if allowed_explicit_matchers.include?(name) - name.start_with?('be_', 'have_') && !name.end_with?('?') || + (name.start_with?('be_', 'have_') && !name.end_with?('?')) || %w[include respond_to].include?(name) end def message_explicit(matcher) format(MSG_EXPLICIT,