lib/rubocop/cop/rspec/verified_doubles.rb in rubocop-rspec-1.6.0 vs lib/rubocop/cop/rspec/verified_doubles.rb in rubocop-rspec-1.7.0
- old
+ new
@@ -2,12 +2,13 @@
module RuboCop
module Cop
module RSpec
# Prefer using verifying doubles over normal doubles.
- # see: https://relishapp.com/rspec/rspec-mocks/docs/verifying-doubles
#
+ # @see https://relishapp.com/rspec/rspec-mocks/docs/verifying-doubles
+ #
# @example
# # bad
# it '...' do
# widget = double("Widget")
# end
@@ -15,9 +16,11 @@
# # good
# it '...' do
# widget = instance_double("Widget")
# end
class VerifiedDoubles < Cop
+ include RuboCop::RSpec::SpecOnly
+
MSG = 'Prefer using verifying doubles over normal doubles.'.freeze
def_node_matcher :unverified_double, <<-PATTERN
{(send nil {:double :spy} $_ ...) }
PATTERN