Sha256: 5e976872daeb9cdc59962ab855c4ce2941740878331a836ce7d7e6c8cb7d3c65

Contents?: true

Size: 541 Bytes

Versions: 10

Compression:

Stored size: 541 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    module Minitest
      # This cop enforces to use `refute_empty` instead of
      # using `refute(object.empty?)`.
      #
      # @example
      #   # bad
      #   refute(object.empty?)
      #   refute(object.empty?, 'message')
      #
      #   # good
      #   refute_empty(object)
      #   refute_empty(object, 'message')
      #
      class RefuteEmpty < Cop
        extend MinitestCopRule

        define_rule :refute, target_method: :empty?
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rubocop-minitest-0.11.1 lib/rubocop/cop/minitest/refute_empty.rb
rubocop-minitest-0.11.0 lib/rubocop/cop/minitest/refute_empty.rb
rubocop-minitest-0.10.3 lib/rubocop/cop/minitest/refute_empty.rb
rubocop-minitest-0.10.2 lib/rubocop/cop/minitest/refute_empty.rb
rubocop-minitest-0.10.1 lib/rubocop/cop/minitest/refute_empty.rb
rubocop-minitest-0.10.0 lib/rubocop/cop/minitest/refute_empty.rb
rubocop-minitest-0.9.0 lib/rubocop/cop/minitest/refute_empty.rb
rubocop-minitest-0.8.1 lib/rubocop/cop/minitest/refute_empty.rb
rubocop-minitest-0.8.0 lib/rubocop/cop/minitest/refute_empty.rb
rubocop-minitest-0.7.0 lib/rubocop/cop/minitest/refute_empty.rb