lib/rubocop/cop/rspec/message_spies.rb in rubocop-rspec-1.32.0 vs lib/rubocop/cop/rspec/message_spies.rb in rubocop-rspec-1.33.0
- old
+ new
@@ -25,20 +25,19 @@
# expect(foo).to receive(:bar)
#
class MessageSpies < Cop
include ConfigurableEnforcedStyle
- MSG_RECEIVE = 'Prefer `receive` for setting message '\
- 'expectations.'.freeze
+ MSG_RECEIVE = 'Prefer `receive` for setting message expectations.'
MSG_HAVE_RECEIVED = 'Prefer `have_received` for setting message '\
'expectations. Setup `%<source>s` as a spy using '\
- '`allow` or `instance_spy`.'.freeze
+ '`allow` or `instance_spy`.'
SUPPORTED_STYLES = %w[have_received receive].freeze
def_node_matcher :message_expectation, %(
- (send (send nil? :expect $_) {:to :to_not :not_to} ...)
+ (send (send nil? :expect $_) #{Runners::ALL.node_pattern_union} ...)
)
def_node_search :receive_message, %(
$(send nil? {:receive :have_received} ...)
)