Sha256: e57c30eb301a85659a1d16c52f0be60cb598bc8bf26d8ad4dd0d7bbb09b85b6a

Contents?: true

Size: 550 Bytes

Versions: 10

Compression:

Stored size: 550 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    module Minitest
      # This cop enforces the test to use `assert_empty`
      # instead of using `assert(object.empty?)`.
      #
      # @example
      #   # bad
      #   assert(object.empty?)
      #   assert(object.empty?, 'message')
      #
      #   # good
      #   assert_empty(object)
      #   assert_empty(object, 'message')
      #
      class AssertEmpty < Cop
        extend MinitestCopRule

        define_rule :assert, 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/assert_empty.rb
rubocop-minitest-0.11.0 lib/rubocop/cop/minitest/assert_empty.rb
rubocop-minitest-0.10.3 lib/rubocop/cop/minitest/assert_empty.rb
rubocop-minitest-0.10.2 lib/rubocop/cop/minitest/assert_empty.rb
rubocop-minitest-0.10.1 lib/rubocop/cop/minitest/assert_empty.rb
rubocop-minitest-0.10.0 lib/rubocop/cop/minitest/assert_empty.rb
rubocop-minitest-0.9.0 lib/rubocop/cop/minitest/assert_empty.rb
rubocop-minitest-0.8.1 lib/rubocop/cop/minitest/assert_empty.rb
rubocop-minitest-0.8.0 lib/rubocop/cop/minitest/assert_empty.rb
rubocop-minitest-0.7.0 lib/rubocop/cop/minitest/assert_empty.rb