lib/rubocop/cop/rspec/be.rb in rubocop-rspec-1.32.0 vs lib/rubocop/cop/rspec/be.rb in rubocop-rspec-1.33.0
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
module RuboCop
module Cop
module RSpec
# Check for expectations where `be` is used without argument.
#
@@ -16,13 +18,13 @@
# expect(foo).to be_truthy
# expect(foo).to be 1.0
# expect(foo).to be(true)
#
class Be < Cop
- MSG = 'Don\'t use `be` without an argument.'.freeze
+ MSG = 'Don\'t use `be` without an argument.'
def_node_matcher :be_without_args, <<-PATTERN
- (send _ {:to :not_to :to_not} $(send nil? :be))
+ (send _ #{Runners::ALL.node_pattern_union} $(send nil? :be))
PATTERN
def on_send(node)
be_without_args(node) do |matcher|
add_offense(matcher, location: :selector)