lib/rubocop/cop/discourse/time_eq_matcher.rb in rubocop-discourse-2.0.0 vs lib/rubocop/cop/discourse/time_eq_matcher.rb in rubocop-discourse-2.0.1
- old
+ new
@@ -17,11 +17,11 @@
def_node_matcher :using_eq_matcher_with_timestamp?, <<-MATCHER
(send
(send nil? :expect
(send ... #timestamp_suffix?))
{:to :not_to :to_not}
- (send nil? :eq #not_nil))
+ (send nil? :eq #not_nil?))
MATCHER
def on_send(node)
return unless using_eq_matcher_with_timestamp?(node)
@@ -38,11 +38,11 @@
def timestamp_suffix?(property)
property =~ /_at$/
end
- def not_nil(expression)
- expression != [s(:nil)]
+ def not_nil?(expression)
+ !expression.nil_type?
end
end
end
end
end