Sha256: 3a23dc90fd563e3d198b911831224ddf09cb8609f0f1d101868f9b3e4acb1df5
Contents?: true
Size: 765 Bytes
Versions: 14
Compression:
Stored size: 765 Bytes
Contents
# frozen_string_literal: true module RuboCop module Cop module Minitest # This cop enforces the use of `assert_respond_to(object, :do_something)` # over `assert(object.respond_to?(:do_something))`. # # @example # # bad # assert(object.respond_to?(:do_something)) # assert(object.respond_to?(:do_something), 'message') # assert(respond_to?(:do_something)) # # # good # assert_respond_to(object, :do_something) # assert_respond_to(object, :do_something, 'message') # assert_respond_to(self, :do_something) # class AssertRespondTo < Base extend MinitestCopRule define_rule :assert, target_method: :respond_to? end end end end
Version data entries
14 entries across 14 versions & 1 rubygems