lib/rubocop/cop/rspec/not_to_not.rb in rubocop-rspec-1.5.1 vs lib/rubocop/cop/rspec/not_to_not.rb in rubocop-rspec-1.5.2
- old
+ new
@@ -1,7 +1,5 @@
-# encoding: utf-8
-
module RuboCop
module Cop
module RSpec
# Enforces the usage of the same method on all negative message
# expectations.
@@ -26,28 +24,28 @@
def on_send(node)
_receiver, method_name, *_args = *node
return unless METHOD_NAMES.include?(method_name)
- return if style == method_name
+ return if style.equal?(method_name)
add_offense(node, :expression)
end
def message(node)
_receiver, method_name, *_args = *node
- if method_name == :not_to
+ if method_name.equal?(:not_to)
format(MSG, 'to_not', 'not_to')
else
format(MSG, 'not_to', 'to_not')
end
end
def autocorrect(node)
_receiver, method_name, *_args = *node
lambda do |corrector|
corrector.replace(node.loc.selector,
- method_name == :not_to ? 'to_not' : 'not_to')
+ method_name.equal?(:not_to) ? 'to_not' : 'not_to')
end
end
end
end
end