Skip to content

Commit

Permalink
[Fix rubocop#73] The Minitest department works on _test.rb by default
Browse files Browse the repository at this point in the history
Fixes rubocop#73.

This PR changes the Minitest department works on file names end with
`_test.rb` by default.

RuboCop Minitest only targets files in `test` directory by default until v0.8.1.

```yaml
Minitest:
  Enabled: true
  Include:
    - '**/test/**/*'
```

https://github.com/rubocop-hq/rubocop-minitest/blob/v0.8.1/config/default.yml

But test files may be located in a directory other than `test` directory.
This PR adds files that end of filename is `_test.rb` to be considered test files.

This behavior is similar to how RuboCop RSpec works on `_spec.rb`.
https://github.com/rubocop-hq/rubocop-rspec/blob/v1.38.1/config/default.yml#L5
  • Loading branch information
koic committed Apr 10, 2020
1 parent b6df77e commit fe40b8a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## master (unreleased)

### Changes

* [#73](https://github.com/rubocop-hq/rubocop-minitest/issues/73): The Minitest department works on file names end with `_test.rb` by default. ([@koic][])

## 0.8.1 (2020-04-06)

### Bug fixes
Expand Down
1 change: 1 addition & 0 deletions config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Minitest:
Enabled: true
Include:
- '**/test/**/*'
- '**/*_test.rb'

Minitest/AssertEmpty:
Description: 'This cop enforces the test to use `assert_empty` instead of using `assert(object.empty?)`.'
Expand Down

0 comments on commit fe40b8a

Please sign in to comment.