RuboCop Minitest

repository·master·Indexed 41 days ago

https://github.com/rubocop/rubocop-minitest

A RuboCop extension that enforces best practices and coding conventions for Minitest based on the community Minitest Style Guide. It includes specialized cops for test naming, assertion usage, and lifecycle hook ordering, as well as RuboCop::TestCase for testing custom cops.

Tokens
7.4K
Snippets
31
Records
66
Agent score
50%

What's inside RuboCop Minitest

  1. Breaking Change: Minitest/AssertEmptyLiteral behavior update

    master
    In version 0.11.0, the Minitest/AssertEmptyLiteral cop was updated to check for assert_equal([], array) instead of assert([], array). This is a breaking change that may require updating existing test assertions to use assert_equal with an empty array literal to satisfy the cop.
  2. Breaking Change: Automatic cop resolution in Minitest tests

    master

    In version 0.40.0, the inspect_source and investigate methods in the Minitest test support no longer accept a cop argument. The cop under test is now resolved automatically based on the test class context.

    Additionally, the test configuration now automatically:

    1. Merges the default configuration for the cop under test.
    2. Sets AllCops: TargetRubyVersion explicitly.
  3. Support Active Support's `test` method in Minitest cops

    master
    As of version v0.13.0, the Minitest/MultipleAssertions and Minitest/NoAssertions cops now support the test method provided by Active Support. This allows these cops to correctly identify and lint assertion usage within Active Support-style test definitions.