Sha256: a55b2d23c6fdc7d35e49c0a451a0cda3f0b10ff637816cc9542851fb7d21535f
Contents?: true
Size: 652 Bytes
Versions: 12
Compression:
Stored size: 652 Bytes
Contents
# frozen_string_literal: true module RuboCop module Cop module Minitest # Enforces the use of `assert_same(expected, actual)` # over `assert(expected.equal?(actual))`. # # NOTE: Use `assert_same` only when there is a need to compare by identity. # Otherwise, use `assert_equal`. # # @example # # bad # assert(expected.equal?(actual)) # # # good # assert_same(expected, actual) # class AssertSame < Base extend MinitestCopRule define_rule :assert, target_method: :equal?, preferred_method: :assert_same end end end end
Version data entries
12 entries across 12 versions & 1 rubygems