Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rubocop/rubocop-minitest
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.22.2
Choose a base ref
...
head repository: rubocop/rubocop-minitest
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.27.0
Choose a head ref

Commits on Oct 1, 2022

  1. Copy the full SHA
    6e78333 View commit details

Commits on Oct 13, 2022

  1. [Fix #157] Add new Minitest/EmptyLineBeforeAssertionMethods cop

    Fixes #157.
    
    This PR adds new `Minitest/EmptyLineBeforeAssertionMethods` cop.
    
    This cop enforces empty line before assertion method because it separates assertion phase.
    
    ```ruby
    # bad
    do_something
    assert_equal(expected, actual)
    
    # good
    do_something
    
    assert_equal(expected, actual)
    ```
    koic committed Oct 13, 2022
    Copy the full SHA
    6d8a9e7 View commit details

Commits on Oct 15, 2022

  1. Merge pull request #163 from koic/add_new_minitest_empty_line_before_…

    …assertion_method_cop
    
    [Fix #157] Add new `Minitest/EmptyLineBeforeAssertionMethods` cop
    koic authored Oct 15, 2022
    Copy the full SHA
    11f5529 View commit details

Commits on Oct 29, 2022

  1. Fix a build error

    Follow up rubocop/rubocop#10987.
    
    ```console
    % bundle exec rake
    (snip)
    
    NoMethodError: undefined method `disabled' for nil:NilClass
    
          registry.disabled(config).each do |cop|
                   ^^^^^^^^^
        /Users/koic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/bundler/gems/rubocop-479e588e16cd/lib/rubocop/comment_config.rb:94:in `inject_disabled_cops_directives'
        /Users/koic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/bundler/gems/rubocop-479e588e16cd/lib/rubocop/comment_config.rb:78:in `analyze'
        /Users/koic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/bundler/gems/rubocop-479e588e16cd/lib/rubocop/comment_config.rb:45:in `cop_disabled_line_ranges'
    ```
    
    It supports multiple RuboCop core versions for compatibility with
    #156.
    koic committed Oct 29, 2022
    Copy the full SHA
    0234244 View commit details

Commits on Oct 30, 2022

  1. Merge pull request #186 from koic/fix_a_build_error

    Fix a build error
    koic authored Oct 30, 2022
    Copy the full SHA
    4f0c4aa View commit details
  2. Update Changelog

    koic committed Oct 30, 2022
    Copy the full SHA
    17cdc58 View commit details
  3. Cut 0.23.0

    koic committed Oct 30, 2022
    Copy the full SHA
    1c13d92 View commit details
  4. Copy the full SHA
    e3176a8 View commit details

Commits on Oct 31, 2022

  1. [Fix #187] Fix an error for Minitest/EmptyLineBeforeAssertionMethods

    Fixes #187.
    
    This PR fixes an error for `Minitest/EmptyLineBeforeAssertionMethods`
    when using method call with block.
    koic committed Oct 31, 2022
    Copy the full SHA
    1bb5d1b View commit details
  2. Merge pull request #188 from koic/fix_an_error_for_minitest_empty_lin…

    …e_before_assertion_methods
    
    [Fix #187] Fix an error for `Minitest/EmptyLineBeforeAssertionMethods`
    koic authored Oct 31, 2022
    Copy the full SHA
    7864020 View commit details

Commits on Nov 1, 2022

  1. Fix a false negative for Minitest/EmptyLineBeforeAssertionMethods

    Fixes part of #189.
    
    This PR fixes a false negative for `Minitest/EmptyLineBeforeAssertionMethods`
    when using non assertion method statement before assertion method used in a block.
    koic committed Nov 1, 2022
    Copy the full SHA
    7d612d7 View commit details

Commits on Nov 2, 2022

  1. [Fix #190] Fix an incorrect autocorrect for `Minitest/EmptyLineBefore…

    …AssertionMethods`
    
    Fixes #190.
    
    This PR fixes an incorrect autocorrect for `Minitest/EmptyLineBeforeAssertionMethods`
    when using method call with source code comment before assertion method.
    koic committed Nov 2, 2022
    Copy the full SHA
    980995b View commit details
  2. Merge pull request #191 from koic/fix_false_negative_for_minitest_emp…

    …ty_line_before_assertion_methods
    
    Fix a false negative for `Minitest/EmptyLineBeforeAssertionMethods`
    koic authored Nov 2, 2022
    Copy the full SHA
    62abedc View commit details

Commits on Nov 3, 2022

  1. Fix a false positive for Minitest/EmptyLineBeforeAssertionMethods

    Follow up #189 (comment).
    
    This PR fixes a false positive for `Minitest/EmptyLineBeforeAssertionMethods`
    when using `rescue` before assertion method.
    koic committed Nov 3, 2022
    Copy the full SHA
    e3b4936 View commit details

Commits on Nov 4, 2022

  1. Merge pull request #193 from koic/fix_a_false_positive_for_minitest_e…

    …mpty_line_before_assertion_methods
    
    Fix a false positive for `Minitest/EmptyLineBeforeAssertionMethods`
    koic authored Nov 4, 2022
    Copy the full SHA
    80595d0 View commit details
  2. Merge pull request #192 from koic/fix_an_incorrect_autocorrect_for_mi…

    …nitest_empty_line_before_assertion_methods
    
    [Fix #190] Fix an incorrect autocorrect for `Minitest/EmptyLineBeforeAssertionMethods`
    koic authored Nov 4, 2022
    Copy the full SHA
    f4c6b6a View commit details
  3. [Fix #189] Fix a false positive for `Minitest/EmptyLineBeforeAssertio…

    …nMethods`
    
    Fixes #189 and #194.
    
    This PR fixes a false negative for `Minitest/EmptyLineBeforeAssertionMethods`
    when using assertion method used in block before assertion method.
    koic committed Nov 4, 2022
    Copy the full SHA
    ec4848c View commit details

Commits on Nov 5, 2022

  1. Merge pull request #195 from koic/fix_false_positive_for_minitest_emp…

    …ty_line_before_assertion_methods
    
    [Fix #189] Fix a false positive for `Minitest/EmptyLineBeforeAssertionMethods`
    koic authored Nov 5, 2022
    Copy the full SHA
    acdbdef View commit details

Commits on Nov 7, 2022

  1. Update Changelog

    koic committed Nov 7, 2022
    Copy the full SHA
    038f8f0 View commit details
  2. Cut 0.23.1

    koic committed Nov 7, 2022
    Copy the full SHA
    0e45ad2 View commit details
  3. Copy the full SHA
    e822d6e View commit details

Commits on Nov 11, 2022

  1. [Fix #196] Fix a false positive for EmptyLineBeforeAssertionMethods

    Addresses #196
    
    Fix a false positive when using an assertion method as the first
    line within a test block
    
    Co-authored-by: Ryan Quanz <ryan.quanz@shopify.com>
    Krishan Bhasin and ryanquanz committed Nov 11, 2022
    Copy the full SHA
    8802a80 View commit details
  2. Merge pull request #197 from krishanbhasin-shopify/master

    Fix a false positive for `Minitest/EmptyLineBeforeAssertionMethods`
    koic authored Nov 11, 2022
    Copy the full SHA
    dca5659 View commit details
  3. Update Changelog

    koic committed Nov 11, 2022
    Copy the full SHA
    5bfe349 View commit details
  4. Cut 0.23.2

    koic committed Nov 11, 2022
    Copy the full SHA
    f126ead View commit details
  5. Copy the full SHA
    c4f9d8b View commit details

Commits on Nov 12, 2022

  1. Apply some changelog format tests to changelog directory

    This commit applies some changelog format tests to changelog directory
    to prevent the following error when running `rake changelog:merge`.
    
    ```console
    % bundle exec rake changelog:merge
    rake aborted!
    NoMethodError: undefined method `[]' for nil:NilClass
    
      entry.match(/\. \((?<contributors>.+)\)\n/)[:contributors].split(',')
                                                 ^^^^^^^^^^^^^^^
    /Users/koic/src/github.com/rubocop/rubocop-minitest/tasks/changelog.rb:130:in `block in contributors'
    /Users/koic/src/github.com/rubocop/rubocop-minitest/tasks/changelog.rb:129:in `each'
    /Users/koic/src/github.com/rubocop/rubocop-minitest/tasks/changelog.rb:129:in `flat_map'
    /Users/koic/src/github.com/rubocop/rubocop-minitest/tasks/changelog.rb:129:in `contributors'
    /Users/koic/src/github.com/rubocop/rubocop-minitest/tasks/changelog.rb:123:in `new_contributor_lines'
    /Users/koic/src/github.com/rubocop/rubocop-minitest/tasks/changelog.rb:105:in `merge_content'
    /Users/koic/src/github.com/rubocop/rubocop-minitest/tasks/changelog.rb:94:in `merge!'
    tasks/changelog.rake:21:in `block (2 levels) in <top (required)>'
    /Users/koic/.rbenv/versions/3.1.2/bin/bundle:25:in `load'
    /Users/koic/.rbenv/versions/3.1.2/bin/bundle:25:in `<main>'
    Tasks: TOP => changelog:merge
    (See full trace by running task with --trace)
    ```
    
    This error occurs when there is no period in the changelog format. It is because the tests
    applied to CHANGELOG.md were not applied to the changelog directory.
    koic committed Nov 12, 2022
    Copy the full SHA
    06bd6bf View commit details

Commits on Nov 22, 2022

  1. Fix a bug for a project test

    It needs to be `File.read` to test a changelog content.
    Otherwise it remains the path returned by `Dir.glob`.
    koic committed Nov 22, 2022
    Copy the full SHA
    870dad0 View commit details

Commits on Nov 23, 2022

  1. Fix typos

    koic committed Nov 23, 2022
    Copy the full SHA
    87abc2c View commit details

Commits on Nov 24, 2022

  1. Copy the full SHA
    f2d0dda View commit details

Commits on Nov 25, 2022

  1. Merge pull request #199 from fatkodima/skip_without_comment-cop

    Add new `Minitest/SkipWithoutComment` cop
    koic authored Nov 25, 2022
    Copy the full SHA
    aa58a56 View commit details

Commits on Nov 27, 2022

  1. Update Changelog

    koic committed Nov 27, 2022
    Copy the full SHA
    28d63d8 View commit details
  2. Cut 0.24.0

    koic committed Nov 27, 2022
    Copy the full SHA
    0223d10 View commit details
  3. Copy the full SHA
    df7b29d View commit details

Commits on Nov 30, 2022

  1. Added dependabot for GitHub Actions

    How about using dependabot in this way?
    When this works, a PullRequest is created as follows:
    - ruby/bigdecimal#242
    
    It was created with reference to the following:
    - ruby/csv#265
    ydah committed Nov 30, 2022
    Copy the full SHA
    63ca919 View commit details
  2. Merge pull request #201 from ydah/dependabot

    Added dependabot for GitHub Actions
    koic authored Nov 30, 2022
    Copy the full SHA
    1bb18b7 View commit details
  3. Bump actions/setup-python from 2 to 4

    Bumps [actions/setup-python](https://github.com/actions/setup-python) from 2 to 4.
    - [Release notes](https://github.com/actions/setup-python/releases)
    - [Commits](actions/setup-python@v2...v4)
    
    ---
    updated-dependencies:
    - dependency-name: actions/setup-python
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Nov 30, 2022
    Copy the full SHA
    c1c363f View commit details

Commits on Dec 3, 2022

  1. Merge pull request #202 from rubocop/dependabot/github_actions/action…

    …s/setup-python-4
    
    Bump actions/setup-python from 2 to 4
    koic authored Dec 3, 2022
    Copy the full SHA
    0c34fed View commit details
  2. [Fix #200] Support it testing block for minitest/spec

    Fixes #200.
    
    This PR supports `it` testing block for minitest/spec.
    
    `Minitest/GlobalExpectations` is already supported,
    so `it` testing block can also be supported by RuboCop Minitest.
    koic committed Dec 3, 2022
    Copy the full SHA
    f913555 View commit details

Commits on Dec 5, 2022

  1. Merge pull request #203 from koic/support_it_block

    [Fix #200] Support `it` testing block for minitest/spec
    koic authored Dec 5, 2022
    Copy the full SHA
    2ae881b View commit details

Commits on Dec 10, 2022

  1. Update Changelog

    koic committed Dec 10, 2022
    Copy the full SHA
    169aa24 View commit details
  2. Cut 0.25.0

    koic committed Dec 10, 2022
    Copy the full SHA
    ca5ddbf View commit details
  3. Copy the full SHA
    b97ae78 View commit details

Commits on Dec 17, 2022

  1. Raise severity of some cops to warning

    The cops below belong to linting, not style preference,
    so make set the severity to warning.
    
    The following emulates warnings for deprecated APIs:
    
    - Minitest/GlobalExpectations (#60)
    
    The following suggests incorrect usage of APIs:
    
    - Minitest/AssertRaisesWithRegexpArgument:
    - Minitest/AssertWithExpectedArgument:
    - Minitest/SkipEnsure:
    - Minitest/UnreachableAssertion:
    koic committed Dec 17, 2022
    Copy the full SHA
    1061906 View commit details

Commits on Dec 23, 2022

  1. [Fix #206] Make Minitest/AssertWithExpectedArgument aware of messag…

    …e variable
    
    Fixes #206.
    
    This PR makes `Minitest/AssertWithExpectedArgument` aware of message variable.
    
    The second argument to the `assert` method named `message` and `msg` is allowed.
    Because their names are inferred as message arguments.
    koic committed Dec 23, 2022
    Copy the full SHA
    a4f7cd4 View commit details
  2. Copy the full SHA
    8f60f45 View commit details
  3. Merge pull request #208 from koic/make_minitest_assert_with_expected_…

    …argument_aware_of_message_variable
    
    [Fix #206] Make `Minitest/AssertWithExpectedArgument` aware of message variable
    koic authored Dec 23, 2022
    Copy the full SHA
    36dcb4c View commit details

Commits on Dec 25, 2022

  1. Update Changelog

    koic committed Dec 25, 2022
    Copy the full SHA
    d9e0050 View commit details
  2. Cut 0.25.1

    koic committed Dec 25, 2022
    Copy the full SHA
    ba2ed64 View commit details
  3. Copy the full SHA
    319cb38 View commit details
Showing with 2,266 additions and 87 deletions.
  1. +5 −2 .circleci/config.yml
  2. +6 −0 .github/dependabot.yml
  3. +3 −0 .github/workflows/linting.yml
  4. +5 −1 .github/workflows/spell_checking.yml
  5. +6 −0 .rubocop.yml
  6. +81 −0 CHANGELOG.md
  7. +1 −1 LICENSE.txt
  8. +53 −1 config/default.yml
  9. +1 −1 docs/antora.yml
  10. +7 −0 docs/modules/ROOT/pages/cops.adoc
  11. +335 −11 docs/modules/ROOT/pages/cops_minitest.adoc
  12. +26 −0 lib/rubocop/cop/minitest/assert_same.rb
  13. +10 −0 lib/rubocop/cop/minitest/assert_truthy.rb
  14. +7 −1 lib/rubocop/cop/minitest/assert_with_expected_argument.rb
  15. +101 −0 lib/rubocop/cop/minitest/empty_line_before_assertion_methods.rb
  16. +0 −5 lib/rubocop/cop/minitest/multiple_assertions.rb
  17. +0 −7 lib/rubocop/cop/minitest/no_assertions.rb
  18. +55 −0 lib/rubocop/cop/minitest/non_public_test_method.rb
  19. +10 −0 lib/rubocop/cop/minitest/refute_false.rb
  20. +26 −0 lib/rubocop/cop/minitest/refute_same.rb
  21. +66 −0 lib/rubocop/cop/minitest/skip_without_reason.rb
  22. +46 −0 lib/rubocop/cop/minitest/test_file_name.rb
  23. +1 −12 lib/rubocop/cop/minitest/test_method_name.rb
  24. +75 −0 lib/rubocop/cop/minitest/useless_assertion.rb
  25. +7 −0 lib/rubocop/cop/minitest_cops.rb
  26. +20 −5 lib/rubocop/cop/mixin/minitest_exploration_helpers.rb
  27. +44 −3 lib/rubocop/minitest/assert_offense.rb
  28. +1 −1 lib/rubocop/minitest/version.rb
  29. +5 −0 relnotes/v0.23.0.md
  30. +9 −0 relnotes/v0.23.1.md
  31. +5 −0 relnotes/v0.23.2.md
  32. +5 −0 relnotes/v0.24.0.md
  33. +5 −0 relnotes/v0.25.0.md
  34. +5 −0 relnotes/v0.25.1.md
  35. +18 −0 relnotes/v0.26.0.md
  36. +7 −0 relnotes/v0.26.1.md
  37. +16 −0 relnotes/v0.27.0.md
  38. +41 −21 tasks/changelog.rb
  39. +18 −7 test/project_test.rb
  40. +2 −2 test/rubocop/cop/minitest/assert_includes_test.rb
  41. +2 −2 test/rubocop/cop/minitest/assert_predicate_test.rb
  42. +108 −0 test/rubocop/cop/minitest/assert_same_test.rb
  43. +20 −0 test/rubocop/cop/minitest/assert_with_expected_argument_test.rb
  44. +409 −0 test/rubocop/cop/minitest/empty_line_before_assertion_methods_test.rb
  45. +13 −0 test/rubocop/cop/minitest/multiple_assertions_test.rb
  46. +20 −1 test/rubocop/cop/minitest/no_assertions_test.rb
  47. +75 −0 test/rubocop/cop/minitest/non_public_test_method_test.rb
  48. +1 −1 test/rubocop/cop/minitest/refute_includes_test.rb
  49. +2 −2 test/rubocop/cop/minitest/refute_predicate_test.rb
  50. +108 −0 test/rubocop/cop/minitest/refute_same_test.rb
  51. +120 −0 test/rubocop/cop/minitest/skip_without_reason_test.rb
  52. +51 −0 test/rubocop/cop/minitest/test_file_name_test.rb
  53. +153 −0 test/rubocop/cop/minitest/useless_assertion_test.rb
  54. +50 −0 test/rubocop/cop/mixin/minitest_exploration_helpers_test.rb
7 changes: 5 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ jobs:
image:
description: "Name of the Docker image."
type: string
default: "cimg/ruby:3.1"
default: "cimg/ruby:3.2"
docker:
- image: << parameters.image >>
environment:
@@ -23,7 +23,7 @@ jobs:
# Miscellaneous tasks
documentation-checks:
docker:
- image: cimg/ruby:3.1
- image: cimg/ruby:3.2
steps:
- checkout
- run: bundle install
@@ -47,6 +47,9 @@ workflows:
- rake_default:
name: Ruby 3.1
image: cimg/ruby:3.1
- rake_default:
name: Ruby 3.2
image: cimg/ruby:3.2
- rake_default:
name: Ruby HEAD
image: rubocophq/circleci-ruby-snapshot:latest # Nightly snapshot build
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'weekly'
3 changes: 3 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Linting
on:
- pull_request
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
yamllint:
name: Yamllint
6 changes: 5 additions & 1 deletion .github/workflows/spell_checking.yml
Original file line number Diff line number Diff line change
@@ -2,6 +2,10 @@ name: Spell Checking

on: [pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
codespell:
name: Check spelling of all files with codespell
@@ -12,7 +16,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
6 changes: 6 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -31,6 +31,9 @@ Naming/InclusiveLanguage:
Enabled: true
CheckStrings: true
FlaggedTerms:
' a offense':
Suggestions:
- an offense
auto-correct:
Suggestions:
- autocorrect
@@ -43,6 +46,9 @@ Naming/InclusiveLanguage:
offence:
Suggestions:
- offense
does_not_registers:
Suggestions:
- does_not_register

Style/FormatStringToken:
# Because we parse a lot of source codes from strings. Percent arrays
81 changes: 81 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,86 @@

## master (unreleased)

## 0.27.0 (2023-01-30)

### New features

* [#220](https://github.com/rubocop/rubocop-minitest/issues/220): Add new `Minitest/NonPublicTestMethod` cop. ([@fatkodima][])

### Bug fixes

* [#237](https://github.com/rubocop/rubocop-minitest/pull/237): Fix a false positive for `Minitest/UselessAssertion` when using command execution. ([@fatkodima][])

### Changes

* [#234](https://github.com/rubocop/rubocop-minitest/pull/234): Mark `Minitest/AssertTruthy` as unsafe. ([@koic][])
* [#233](https://github.com/rubocop/rubocop-minitest/pull/233): Mark `Minitest/RefuteFalse` as unsafe. ([@koic][])
* [#231](https://github.com/rubocop/rubocop-minitest/pull/231): Change what is considered a test case by `rubocop-minitest` (`public` method without arguments with `test_` name prefix). ([@fatkodima][])

## 0.26.1 (2023-01-17)

### Bug fixes

* [#225](https://github.com/rubocop/rubocop-minitest/issues/225): Fix an error for `Minitest/TestFileName` when using empty file. ([@koic][])
* [#223](https://github.com/rubocop/rubocop-minitest/issues/223): Fix a false positive for `Minitest/MultipleAssertions` when using assertion method with block. ([@fatkodima][])

## 0.26.0 (2023-01-15)

### New features

* [#215](https://github.com/rubocop/rubocop-minitest/issues/215): Add new `Minitest/AssertSame` and `Minitest/RefuteSame` cops. ([@tejasbubane][])
* [#213](https://github.com/rubocop/rubocop-minitest/issues/213): Add new `Minitest/TestFileName` cop. ([@tejasbubane][])
* [#205](https://github.com/rubocop/rubocop-minitest/issues/205): Add new `Minitest/UselessAssertion` cop. ([@fatkodima][])

### Bug fixes

* [#210](https://github.com/rubocop/rubocop-minitest/issues/210): Fix a false positive for `Minitest/EmptyLineBeforeAssertionMethodsTest` when using assertion method with block arg before other assertion method. ([@koic][])

### Changes

* [#209](https://github.com/rubocop/rubocop-minitest/issues/209): Mark `Minitest/AssertTruthy` as unsafe autocorrection. ([@koic][])
* [#204](https://github.com/rubocop/rubocop-minitest/pull/204): Raise severity of `Minitest/AssertRaisesWithRegexpArgument`, `Minitest/AssertWithExpectedArgument`, `Minitest/GlobalExpectations`, `Minitest/SkipEnsure`, and `Minitest/UnreachableAssertion` cops to warning. ([@koic][])

## 0.25.1 (2022-12-25)

### Changes

* [#206](https://github.com/rubocop/rubocop-minitest/issues/206): Make `Minitest/AssertWithExpectedArgument` aware of message variable. ([@koic][])

## 0.25.0 (2022-12-10)

### New features

* [#200](https://github.com/rubocop/rubocop-minitest/issues/200): Support `it` testing block for minitest/spec. ([@koic][])

## 0.24.0 (2022-11-27)

### New features

* [#198](https://github.com/rubocop/rubocop-minitest/issues/198): Add new `Minitest/SkipWithoutReason` cop. ([@fatkodima][])

## 0.23.2 (2022-11-12)

### Bug fixes

* [#189](https://github.com/rubocop/rubocop-minitest/issues/189): Fix a false positive for `Minitest/EmptyLineBeforeAssertionMethods` when using an assertion method as the first line within a test block. ([@ryanquanz][])

## 0.23.1 (2022-11-07)

### Bug fixes

* [#189](https://github.com/rubocop/rubocop-minitest/issues/189): Fix a false positive for `Minitest/EmptyLineBeforeAssertionMethods` when using `rescue` before assertion method. ([@koic][])
* [#187](https://github.com/rubocop/rubocop-minitest/issues/187): Fix an error for `Minitest/EmptyLineBeforeAssertionMethods` when using method call with block. ([@koic][])
* [#190](https://github.com/rubocop/rubocop-minitest/issues/190): Fix an incorrect autocorrect for `Minitest/EmptyLineBeforeAssertionMethods` when using method call with source code comment before assertion method. ([@koic][])
* [#189](https://github.com/rubocop/rubocop-minitest/issues/189): Fix a false negative for `Minitest/EmptyLineBeforeAssertionMethods` when using non assertion method statement before assertion method used in a block. ([@koic][])
* [#189](https://github.com/rubocop/rubocop-minitest/issues/189): Fix a false negative for `Minitest/EmptyLineBeforeAssertionMethods` when using assertion method used in block before assertion method. ([@koic][])

## 0.23.0 (2022-10-30)

### New features

* [#157](https://github.com/rubocop/rubocop-minitest/issues/157): Add new `Minitest/EmptyLineBeforeAssertionMethods` cop. ([@koic][])

## 0.22.2 (2022-10-01)

### Bug fixes
@@ -357,3 +437,4 @@
[@ippachi]: https://github.com/ippachi
[@r7kamura]: https://github.com/r7kamura
[@rwstauner]: https://github.com/rwstauner
[@ryanquanz]: https://github.com/ryanquanz
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2019-2022 Bozhidar Batsov, Jonas Arvidsson, Koichi ITO
Copyright (c) 2019-2023 Bozhidar Batsov, Jonas Arvidsson, Koichi ITO

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
54 changes: 53 additions & 1 deletion config/default.yml
Original file line number Diff line number Diff line change
@@ -85,14 +85,22 @@ Minitest/AssertRaisesCompoundBody:
Minitest/AssertRaisesWithRegexpArgument:
Description: 'This cop enforces checks for regular expression literals passed to `assert_raises`.'
Enabled: pending
Severity: warning
VersionAdded: '0.22'
VersionChanged: '0.26'

Minitest/AssertRespondTo:
Description: 'This cop enforces the test to use `assert_respond_to(object, :do_something)` over `assert(object.respond_to?(:do_something))`.'
StyleGuide: 'https://minitest.rubystyle.guide#assert-responds-to-method'
Enabled: true
VersionAdded: '0.3'

Minitest/AssertSame:
Description: 'Enforces the use of `assert_same(expected, actual)` over `assert(expected.equal?(actual))`.'
StyleGuide: 'https://minitest.rubystyle.guide#assert-same'
Enabled: pending
VersionAdded: '0.26'

Minitest/AssertSilent:
Description: "This cop enforces the test to use `assert_silent { ... }` instead of using `assert_output('', '') { ... }`."
StyleGuide: 'https://github.com/rubocop/minitest-style-guide#assert-silent'
@@ -103,13 +111,17 @@ Minitest/AssertTruthy:
Description: 'This cop enforces the test to use `assert(actual)` instead of using `assert_equal(true, actual)`.'
StyleGuide: 'https://minitest.rubystyle.guide#assert-truthy'
Enabled: true
Safe: false
VersionAdded: '0.2'
VersionChanged: '0.27'

Minitest/AssertWithExpectedArgument:
Description: 'This cop tries to detect when a user accidentally used `assert` when they meant to use `assert_equal`.'
Enabled: pending
Severity: warning
Safe: false
VersionAdded: '0.11'
VersionChanged: '0.26'

Minitest/AssertionInLifecycleHook:
Description: 'This cop checks for usage of assertions in lifecycle hooks.'
@@ -122,10 +134,16 @@ Minitest/DuplicateTestRun:
Enabled: pending
VersionAdded: '0.19'

Minitest/EmptyLineBeforeAssertionMethods:
Description: 'Add empty line before assertion methods.'
Enabled: pending
VersionAdded: '0.23'

Minitest/GlobalExpectations:
Description: 'This cop checks for deprecated global expectations.'
StyleGuide: 'https://minitest.rubystyle.guide#global-expectations'
Enabled: true
Severity: warning
EnforcedStyle: any
Include:
- '**/test/**/*'
@@ -138,7 +156,7 @@ Minitest/GlobalExpectations:
- expect
- value
VersionAdded: '0.7'
VersionChanged: '0.16'
VersionChanged: '0.26'

Minitest/LiteralAsActualArgument:
Description: 'This cop enforces correct order of `expected` and `actual` arguments for `assert_equal`.'
@@ -157,6 +175,12 @@ Minitest/NoAssertions:
Enabled: false
VersionAdded: '0.12'

Minitest/NonPublicTestMethod:
Description: 'Detects non `public` (marked as `private` or `protected`) test methods.'
Enabled: pending
Severity: warning
VersionAdded: '0.27'

Minitest/RefuteEmpty:
Description: 'This cop enforces to use `refute_empty` instead of using `refute(object.empty?)`.'
StyleGuide: 'https://minitest.rubystyle.guide#refute-empty'
@@ -173,7 +197,9 @@ Minitest/RefuteFalse:
Description: 'Check if your test uses `refute(actual)` instead of `assert_equal(false, actual)`.'
StyleGuide: 'https://minitest.rubystyle.guide#refute-false'
Enabled: true
Safe: false
VersionAdded: '0.3'
VersionChanged: '0.27'

Minitest/RefuteInDelta:
Description: 'This cop enforces the test to use `refute_in_delta` instead of using `refute_equal` to compare floats.'
@@ -229,10 +255,29 @@ Minitest/RefuteRespondTo:
Enabled: true
VersionAdded: '0.4'

Minitest/RefuteSame:
Description: 'Enforces the use of `refute_same(expected, actual)` over `refute(expected.equal?(actual))`.'
StyleGuide: 'https://minitest.rubystyle.guide#refute-same'
Enabled: pending
VersionAdded: '0.26'

Minitest/SkipEnsure:
Description: 'Checks that `ensure` call even if `skip`.'
Enabled: pending
Severity: warning
VersionAdded: '0.20'
VersionChanged: '0.26'

Minitest/SkipWithoutReason:
Description: 'Checks for skipped tests missing the skipping reason.'
Enabled: pending
VersionAdded: '0.24'

Minitest/TestFileName:
Description: 'Checks if test file names start with `test_` or end with `_test.rb`.'
StyleGuide: 'https://minitest.rubystyle.guide/#file-naming'
Enabled: pending
VersionAdded: '0.26'

Minitest/TestMethodName:
Description: 'This cop enforces that test method names start with `test_` prefix.'
@@ -242,10 +287,17 @@ Minitest/TestMethodName:
Minitest/UnreachableAssertion:
Description: 'This cop checks for an `assert_raises` block containing any unreachable assertions.'
Enabled: pending
Severity: warning
VersionAdded: '0.14'
VersionChanged: '0.26'

Minitest/UnspecifiedException:
Description: 'This cop checks for a specified error in `assert_raises`.'
StyleGuide: 'https://minitest.rubystyle.guide#unspecified-exception'
Enabled: 'pending'
VersionAdded: '0.10'

Minitest/UselessAssertion:
Description: 'Detects useless assertions (assertions that either always pass or always fail).'
Enabled: pending
VersionAdded: '0.26'
2 changes: 1 addition & 1 deletion docs/antora.yml
Original file line number Diff line number Diff line change
@@ -2,6 +2,6 @@ name: rubocop-minitest
title: RuboCop Minitest
# We always provide version without patch here (e.g. 1.1),
# as patch versions should not appear in the docs.
version: '0.22'
version: '0.27'
nav:
- modules/ROOT/nav.adoc
7 changes: 7 additions & 0 deletions docs/modules/ROOT/pages/cops.adoc
Original file line number Diff line number Diff line change
@@ -28,15 +28,18 @@ based on the https://minitest.rubystyle.guide/[Minitest Style Guide].
* xref:cops_minitest.adoc#minitestassertraisescompoundbody[Minitest/AssertRaisesCompoundBody]
* xref:cops_minitest.adoc#minitestassertraiseswithregexpargument[Minitest/AssertRaisesWithRegexpArgument]
* xref:cops_minitest.adoc#minitestassertrespondto[Minitest/AssertRespondTo]
* xref:cops_minitest.adoc#minitestassertsame[Minitest/AssertSame]
* xref:cops_minitest.adoc#minitestassertsilent[Minitest/AssertSilent]
* xref:cops_minitest.adoc#minitestasserttruthy[Minitest/AssertTruthy]
* xref:cops_minitest.adoc#minitestassertwithexpectedargument[Minitest/AssertWithExpectedArgument]
* xref:cops_minitest.adoc#minitestassertioninlifecyclehook[Minitest/AssertionInLifecycleHook]
* xref:cops_minitest.adoc#minitestduplicatetestrun[Minitest/DuplicateTestRun]
* xref:cops_minitest.adoc#minitestemptylinebeforeassertionmethods[Minitest/EmptyLineBeforeAssertionMethods]
* xref:cops_minitest.adoc#minitestglobalexpectations[Minitest/GlobalExpectations]
* xref:cops_minitest.adoc#minitestliteralasactualargument[Minitest/LiteralAsActualArgument]
* xref:cops_minitest.adoc#minitestmultipleassertions[Minitest/MultipleAssertions]
* xref:cops_minitest.adoc#minitestnoassertions[Minitest/NoAssertions]
* xref:cops_minitest.adoc#minitestnonpublictestmethod[Minitest/NonPublicTestMethod]
* xref:cops_minitest.adoc#minitestrefuteempty[Minitest/RefuteEmpty]
* xref:cops_minitest.adoc#minitestrefuteequal[Minitest/RefuteEqual]
* xref:cops_minitest.adoc#minitestrefutefalse[Minitest/RefuteFalse]
@@ -49,9 +52,13 @@ based on the https://minitest.rubystyle.guide/[Minitest Style Guide].
* xref:cops_minitest.adoc#minitestrefutepathexists[Minitest/RefutePathExists]
* xref:cops_minitest.adoc#minitestrefutepredicate[Minitest/RefutePredicate]
* xref:cops_minitest.adoc#minitestrefuterespondto[Minitest/RefuteRespondTo]
* xref:cops_minitest.adoc#minitestrefutesame[Minitest/RefuteSame]
* xref:cops_minitest.adoc#minitestskipensure[Minitest/SkipEnsure]
* xref:cops_minitest.adoc#minitestskipwithoutreason[Minitest/SkipWithoutReason]
* xref:cops_minitest.adoc#minitesttestfilename[Minitest/TestFileName]
* xref:cops_minitest.adoc#minitesttestmethodname[Minitest/TestMethodName]
* xref:cops_minitest.adoc#minitestunreachableassertion[Minitest/UnreachableAssertion]
* xref:cops_minitest.adoc#minitestunspecifiedexception[Minitest/UnspecifiedException]
* xref:cops_minitest.adoc#minitestuselessassertion[Minitest/UselessAssertion]

// END_COP_LIST
Loading