rubocop-minitest 0.6.2 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.circleci/config.yml +0 -3
- data/.gitattributes +1 -0
- data/.rubocop.yml +2 -1
- data/.rubocop_todo.yml +0 -7
- data/CHANGELOG.md +65 -0
- data/Gemfile +1 -1
- data/README.md +5 -1
- data/Rakefile +29 -0
- data/config/default.yml +103 -18
- data/docs/antora.yml +7 -0
- data/docs/modules/ROOT/nav.adoc +6 -0
- data/docs/modules/ROOT/pages/cops.adoc +37 -0
- data/docs/modules/ROOT/pages/cops_minitest.adoc +1014 -0
- data/docs/modules/ROOT/pages/index.adoc +5 -0
- data/docs/modules/ROOT/pages/installation.adoc +15 -0
- data/docs/modules/ROOT/pages/usage.adoc +32 -0
- data/{manual → legacy-docs}/cops.md +1 -0
- data/{manual → legacy-docs}/cops_minitest.md +64 -41
- data/{manual → legacy-docs}/index.md +0 -0
- data/{manual → legacy-docs}/installation.md +0 -0
- data/{manual → legacy-docs}/usage.md +0 -0
- data/lib/rubocop/cop/generator.rb +56 -0
- data/lib/rubocop/cop/minitest/assert_empty.rb +4 -30
- data/lib/rubocop/cop/minitest/assert_empty_literal.rb +15 -0
- data/lib/rubocop/cop/minitest/assert_equal.rb +2 -31
- data/lib/rubocop/cop/minitest/assert_in_delta.rb +27 -0
- data/lib/rubocop/cop/minitest/assert_includes.rb +4 -4
- data/lib/rubocop/cop/minitest/assert_instance_of.rb +4 -38
- data/lib/rubocop/cop/minitest/assert_kind_of.rb +25 -0
- data/lib/rubocop/cop/minitest/assert_match.rb +4 -39
- data/lib/rubocop/cop/minitest/assert_nil.rb +2 -2
- data/lib/rubocop/cop/minitest/assert_output.rb +49 -0
- data/lib/rubocop/cop/minitest/assert_path_exists.rb +58 -0
- data/lib/rubocop/cop/minitest/assert_respond_to.rb +10 -45
- data/lib/rubocop/cop/minitest/assert_silent.rb +45 -0
- data/lib/rubocop/cop/minitest/assert_truthy.rb +2 -2
- data/lib/rubocop/cop/minitest/assertion_in_lifecycle_hook.rb +43 -0
- data/lib/rubocop/cop/minitest/global_expectations.rb +95 -0
- data/lib/rubocop/cop/minitest/literal_as_actual_argument.rb +52 -0
- data/lib/rubocop/cop/minitest/multiple_assertions.rb +63 -0
- data/lib/rubocop/cop/minitest/refute_empty.rb +4 -30
- data/lib/rubocop/cop/minitest/refute_false.rb +3 -3
- data/lib/rubocop/cop/minitest/refute_in_delta.rb +27 -0
- data/lib/rubocop/cop/minitest/refute_includes.rb +4 -4
- data/lib/rubocop/cop/minitest/refute_instance_of.rb +4 -38
- data/lib/rubocop/cop/minitest/refute_kind_of.rb +25 -0
- data/lib/rubocop/cop/minitest/refute_match.rb +4 -39
- data/lib/rubocop/cop/minitest/refute_nil.rb +2 -2
- data/lib/rubocop/cop/minitest/refute_path_exists.rb +58 -0
- data/lib/rubocop/cop/minitest/refute_respond_to.rb +10 -45
- data/lib/rubocop/cop/minitest/test_method_name.rb +70 -0
- data/lib/rubocop/cop/minitest/unspecified_exception.rb +36 -0
- data/lib/rubocop/cop/minitest_cops.rb +17 -1
- data/lib/rubocop/cop/mixin/argument_range_helper.rb +10 -0
- data/lib/rubocop/cop/mixin/in_delta_mixin.rb +50 -0
- data/lib/rubocop/cop/mixin/minitest_cop_rule.rb +102 -0
- data/lib/rubocop/cop/mixin/minitest_exploration_helpers.rb +84 -0
- data/lib/rubocop/minitest/version.rb +1 -1
- data/mkdocs.yml +2 -2
- data/relnotes/v0.10.0.md +21 -0
- data/relnotes/v0.6.2.md +5 -0
- data/relnotes/v0.7.0.md +13 -0
- data/relnotes/v0.8.0.md +12 -0
- data/relnotes/v0.8.1.md +5 -0
- data/relnotes/v0.9.0.md +10 -0
- data/rubocop-minitest.gemspec +4 -4
- data/tasks/cops_documentation.rake +83 -52
- data/tasks/cut_release.rake +16 -0
- metadata +45 -15
- data/lib/rubocop/cop/mixin/includes_cop_rule.rb +0 -78
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ba38b8b45ed71a06486486456dbda0e2d833f58ccf59fc7e22ecb3a1d4ec2dd7
|
4
|
+
data.tar.gz: 5f5260b7699852144213e044386662b3168eff83068ee88257df478fd79c7314
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: accc29f0bf8c2c80404a0777122446bea1ed7a6d57809b68b4ca21f66aedecdc161c3f29dd0777a61a2bccda158da3cb20892470994d335a4da63a2c09fbc80a
|
7
|
+
data.tar.gz: 8c3c5b4f73bd953c7ced000471c3e91645e36c240d7e73f04631487344c3a9e14152b2c83b3d6dccdf3530936007deb4e3dbc819c6b28e86a34ef5b821802375
|
data/.circleci/config.yml
CHANGED
data/.gitattributes
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
CHANGELOG.md merge=union
|
data/.rubocop.yml
CHANGED
data/.rubocop_todo.yml
CHANGED
@@ -14,10 +14,3 @@ Metrics/AbcSize:
|
|
14
14
|
# Configuration parameters: CountComments, ExcludedMethods.
|
15
15
|
Metrics/MethodLength:
|
16
16
|
Max: 14
|
17
|
-
|
18
|
-
# Offense count: 40
|
19
|
-
# Cop supports --auto-correct.
|
20
|
-
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
21
|
-
# URISchemes: http, https
|
22
|
-
Layout/LineLength:
|
23
|
-
Max: 90
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,68 @@
|
|
2
2
|
|
3
3
|
## master (unreleased)
|
4
4
|
|
5
|
+
## 0.10.0 (2020-07-12)
|
6
|
+
|
7
|
+
### New features
|
8
|
+
|
9
|
+
* [#92](https://github.com/rubocop-hq/rubocop-minitest/pull/92): Add new `Minitest/LiteralAsActualArgument` cop. ([@fatkodima][], [@tsmmark][])
|
10
|
+
* [#95](https://github.com/rubocop-hq/rubocop-minitest/pull/95): Add new `Minitest/AssertionInLifecycleHook` cop. ([@fatkodima][])
|
11
|
+
* [#91](https://github.com/rubocop-hq/rubocop-minitest/pull/91): Add new `Minitest/AssertInDelta` and `Minitest/RefuteInDelta` cops. ([@fatkodima][])
|
12
|
+
* [#89](https://github.com/rubocop-hq/rubocop-minitest/pull/89): Add new `Minitest/TestMethodName` cop. ([@fatkodima][])
|
13
|
+
* [#83](https://github.com/rubocop-hq/rubocop-minitest/pull/83): New cops `AssertPathExists` and `RefutePathExists` check for use of `assert_path_exists`/`refute_path_exists` instead of `assert(File.exist?(path))`/`refute(File.exist?(path))`. ([@fatkodima][])
|
14
|
+
* [#88](https://github.com/rubocop-hq/rubocop-minitest/pull/88): Add new `Minitest/MultipleAssertions` cop. ([@fatkodima][])
|
15
|
+
* [#87](https://github.com/rubocop-hq/rubocop-minitest/pull/87): Add new `Minitest/AssertSilent` cop. ([@fatkodima][])
|
16
|
+
* [#96](https://github.com/rubocop-hq/rubocop-minitest/pull/96): Add new `Minitest/UnspecifiedException` cop. ([@fatkodima][])
|
17
|
+
* [#98](https://github.com/rubocop-hq/rubocop-minitest/pull/98): Add new `Minitest/AssertOutput` cop. ([@fatkodima][])
|
18
|
+
* [#84](https://github.com/rubocop-hq/rubocop-minitest/pull/84): New cops `AssertKindOf` and `RefuteKindOf` check for use of `assert_kind_of`/`refute_kind_of` instead of `assert(foo.kind_of?(Class))`/`refute(foo.kind_of?(Class))`. ([@fatkodima][])
|
19
|
+
* [#85](https://github.com/rubocop-hq/rubocop-minitest/pull/85): Add autocorrect to `Rails/AssertEmptyLiteral` cop. ([@fatkodima][])
|
20
|
+
|
21
|
+
### Changes
|
22
|
+
|
23
|
+
* [#104](https://github.com/rubocop-hq/rubocop-minitest/pull/104): Require RuboCop 0.87 or higher. ([@koic][])
|
24
|
+
|
25
|
+
## 0.9.0 (2020-04-13)
|
26
|
+
|
27
|
+
### Bug fixes
|
28
|
+
|
29
|
+
* [#75](https://github.com/rubocop-hq/rubocop-minitest/issues/75): Fix a false negative for `Minitest/GlobalExpectations` when using global expectation methods with no arguments. ([@koic][])
|
30
|
+
|
31
|
+
### Changes
|
32
|
+
|
33
|
+
* [#73](https://github.com/rubocop-hq/rubocop-minitest/issues/73): The Minitest department works on file names end with `_test.rb` by default. ([@koic][])
|
34
|
+
* [#77](https://github.com/rubocop-hq/rubocop-minitest/pull/77): **(BREAKING)** Drop support for Ruby 2.3. ([@koic][])
|
35
|
+
|
36
|
+
## 0.8.1 (2020-04-06)
|
37
|
+
|
38
|
+
### Bug fixes
|
39
|
+
|
40
|
+
* [#72](https://github.com/rubocop-hq/rubocop-minitest/pull/72): Fix some false negatives for `Minitest/GlobalExpectations`. ([@andrykonchin][])
|
41
|
+
|
42
|
+
## 0.8.0 (2020-03-24)
|
43
|
+
|
44
|
+
### New features
|
45
|
+
|
46
|
+
* [#66](https://github.com/rubocop-hq/rubocop-minitest/issues/66): Support all expectations of `Minitest::Expectations` for `Minitest/GlobalExpectations` cop. ([@koic][])
|
47
|
+
|
48
|
+
### Bug fixes
|
49
|
+
|
50
|
+
* [#60](https://github.com/rubocop-hq/rubocop-minitest/issues/60): Fix `Minitest/GlobalExpectations` autocorrection for chained methods. ([@tejasbubane][])
|
51
|
+
* [#69](https://github.com/rubocop-hq/rubocop-minitest/pull/69): Fix a false negative for `Minitest/GlobalExpectations` cop when using a variable or a hash index for receiver. ([@koic][])
|
52
|
+
* [#71](https://github.com/rubocop-hq/rubocop-minitest/pull/71): Fix a false negative for `Minitest/AssertEqual` when an argument is enclosed in redundant parentheses. ([@koic][])
|
53
|
+
|
54
|
+
## 0.7.0 (2020-03-09)
|
55
|
+
|
56
|
+
### New features
|
57
|
+
|
58
|
+
* [#60](https://github.com/rubocop-hq/rubocop-minitest/issues/60): Add new cop `Minitest/GlobalExpectations` to check for deprecated global expectations. ([@tejasbubane][])
|
59
|
+
|
60
|
+
### Bug fixes
|
61
|
+
|
62
|
+
* [#58](https://github.com/rubocop-hq/rubocop-minitest/pull/58): Fix a false negative for `Minitest/AssertMatch` and `Minitest/RefuteMatch` when an argument is enclosed in redundant parentheses. ([@koic][])
|
63
|
+
* [#59](https://github.com/rubocop-hq/rubocop-minitest/pull/59): Fix a false negative for `Minitest/AssertRespondTo` and `Minitest/RefuteRespondTo` when an argument is enclosed in redundant parentheses. ([@koic][])
|
64
|
+
* [#61](https://github.com/rubocop-hq/rubocop-minitest/pull/61): Fix a false negative for `Minitest/AssertInstanceOf` and `Minitest/RefuteInstanceOf` when an argument is enclosed in redundant parentheses. ([@koic][])
|
65
|
+
* [#62](https://github.com/rubocop-hq/rubocop-minitest/pull/62): Fix a false negative for `Minitest/AssertEmpty` and `Minitest/RefuteEmpty` when an argument is enclosed in redundant parentheses. ([@koic][])
|
66
|
+
|
5
67
|
## 0.6.2 (2020-02-19)
|
6
68
|
|
7
69
|
### Bug fixes
|
@@ -94,3 +156,6 @@
|
|
94
156
|
[@abhaynikam]: https://github.com/abhaynikam
|
95
157
|
[@herwinw]: https://github.com/herwinw
|
96
158
|
[@fsateler]: https://github.com/fsateler
|
159
|
+
[@andrykonchin]: https://github.com/andrykonchin
|
160
|
+
[@fatkodima]: https://github.com/fatkodima
|
161
|
+
[@tsmmark]: https://github.com/tsmmark
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -62,7 +62,7 @@ end
|
|
62
62
|
|
63
63
|
All cops are located under
|
64
64
|
[`lib/rubocop/cop/minitest`](lib/rubocop/cop/minitest), and contain
|
65
|
-
examples/documentation. The documentation is published [here](https://docs.rubocop.org/
|
65
|
+
examples/documentation. The documentation is published [here](https://docs.rubocop.org/rubocop-minitest/).
|
66
66
|
|
67
67
|
In your `.rubocop.yml`, you may treat the Minitest cops just like any other
|
68
68
|
cop. For example:
|
@@ -73,6 +73,10 @@ Minitest/AssertNil:
|
|
73
73
|
- test/my_file_to_ignore_test.rb
|
74
74
|
```
|
75
75
|
|
76
|
+
## Documentation
|
77
|
+
|
78
|
+
You can read a lot more about RuboCop Minitest in its [official docs](https://docs.rubocop.org/rubocop-minitest/).
|
79
|
+
|
76
80
|
## Contributing
|
77
81
|
|
78
82
|
Checkout the [contribution guidelines](CONTRIBUTING.md).
|
data/Rakefile
CHANGED
@@ -15,6 +15,7 @@ end
|
|
15
15
|
|
16
16
|
require 'rubocop/rake_task'
|
17
17
|
require 'rake/testtask'
|
18
|
+
require_relative 'lib/rubocop/cop/generator'
|
18
19
|
|
19
20
|
Rake::TestTask.new do |t|
|
20
21
|
t.libs << 'test'
|
@@ -36,3 +37,31 @@ task default: %i[
|
|
36
37
|
test
|
37
38
|
internal_investigation
|
38
39
|
]
|
40
|
+
|
41
|
+
desc 'Generate a new cop template'
|
42
|
+
task :new_cop, [:cop] do |_task, args|
|
43
|
+
require 'rubocop'
|
44
|
+
|
45
|
+
cop_name = args.fetch(:cop) do
|
46
|
+
warn 'usage: bundle exec rake new_cop[Department/Name]'
|
47
|
+
exit!
|
48
|
+
end
|
49
|
+
|
50
|
+
github_user = `git config github.user`.chop
|
51
|
+
github_user = 'your_id' if github_user.empty?
|
52
|
+
|
53
|
+
generator = RuboCop::Cop::Generator.new(cop_name, github_user)
|
54
|
+
|
55
|
+
generator.write_source
|
56
|
+
generator.write_test
|
57
|
+
generator.inject_require(root_file_path: 'lib/rubocop/cop/minitest_cops.rb')
|
58
|
+
generator.inject_config(config_file_path: 'config/default.yml', version_added: bump_minor_version)
|
59
|
+
|
60
|
+
puts generator.todo
|
61
|
+
end
|
62
|
+
|
63
|
+
def bump_minor_version
|
64
|
+
major, minor, _patch = RuboCop::Minitest::VERSION.split('.')
|
65
|
+
|
66
|
+
"#{major}.#{minor.succ}"
|
67
|
+
end
|
data/config/default.yml
CHANGED
@@ -2,104 +2,189 @@ Minitest:
|
|
2
2
|
Enabled: true
|
3
3
|
Include:
|
4
4
|
- '**/test/**/*'
|
5
|
+
- '**/*_test.rb'
|
5
6
|
|
6
7
|
Minitest/AssertEmpty:
|
7
8
|
Description: 'This cop enforces the test to use `assert_empty` instead of using `assert(object.empty?)`.'
|
8
|
-
StyleGuide: 'https://
|
9
|
+
StyleGuide: 'https://minitest.rubystyle.guide#assert-empty'
|
9
10
|
Enabled: true
|
10
11
|
VersionAdded: '0.2'
|
11
12
|
|
12
13
|
Minitest/AssertEmptyLiteral:
|
13
14
|
Description: 'This cop enforces the test to use `assert_empty` instead of using `assert([], object)` or `assert({}, object)`.'
|
14
15
|
Enabled: true
|
16
|
+
SafeAutoCorrect: false
|
15
17
|
VersionAdded: '0.5'
|
18
|
+
VersionChanged: '0.10'
|
16
19
|
|
17
20
|
Minitest/AssertEqual:
|
18
21
|
Description: 'This cop enforces the test to use `assert_equal` instead of using `assert(expected == actual)`.'
|
19
|
-
StyleGuide: 'https://
|
22
|
+
StyleGuide: 'https://minitest.rubystyle.guide#assert-equal-arguments-order'
|
20
23
|
Enabled: true
|
21
24
|
VersionAdded: '0.4'
|
22
25
|
|
26
|
+
Minitest/AssertInDelta:
|
27
|
+
Description: 'This cop enforces the test to use `assert_in_delta` instead of using `assert_equal` to compare floats.'
|
28
|
+
StyleGuide: 'https://minitest.rubystyle.guide/#assert-in-delta'
|
29
|
+
Enabled: 'pending'
|
30
|
+
VersionAdded: '0.10'
|
31
|
+
|
32
|
+
Minitest/AssertionInLifecycleHook:
|
33
|
+
Description: 'This cop checks for usage of assertions in lifecycle hooks.'
|
34
|
+
Enabled: 'pending'
|
35
|
+
VersionAdded: '0.10'
|
36
|
+
|
23
37
|
Minitest/AssertMatch:
|
24
38
|
Description: 'This cop enforces the test to use `assert_match` instead of using `assert(matcher.match(object))`.'
|
25
|
-
StyleGuide: 'https://
|
39
|
+
StyleGuide: 'https://minitest.rubystyle.guide#assert-match'
|
26
40
|
Enabled: true
|
27
41
|
VersionAdded: '0.6'
|
28
42
|
|
29
43
|
Minitest/AssertIncludes:
|
30
44
|
Description: 'This cop enforces the test to use `assert_includes` instead of using `assert(collection.include?(object))`.'
|
31
|
-
StyleGuide: 'https://
|
45
|
+
StyleGuide: 'https://minitest.rubystyle.guide#assert-includes'
|
32
46
|
Enabled: true
|
33
47
|
VersionAdded: '0.2'
|
34
48
|
|
35
49
|
Minitest/AssertInstanceOf:
|
36
50
|
Description: 'This cop enforces the test to use `assert_instance_of(Class, object)` over `assert(object.instance_of?(Class))`'
|
37
|
-
StyleGuide: 'https://
|
51
|
+
StyleGuide: 'https://minitest.rubystyle.guide#assert-instance-of'
|
38
52
|
Enabled: true
|
39
53
|
VersionAdded: '0.4'
|
40
54
|
|
55
|
+
Minitest/AssertKindOf:
|
56
|
+
Description: 'This cop enforces the test to use `assert_kind_of(Class, object)` over `assert(object.kind_of?(Class))`'
|
57
|
+
StyleGuide: 'https://github.com/rubocop-hq/minitest-style-guide#assert-kind-of'
|
58
|
+
Enabled: 'pending'
|
59
|
+
VersionAdded: '0.10'
|
60
|
+
|
41
61
|
Minitest/AssertNil:
|
42
62
|
Description: 'This cop enforces the test to use `assert_nil` instead of using `assert_equal(nil, something)`.'
|
43
|
-
StyleGuide: 'https://
|
63
|
+
StyleGuide: 'https://minitest.rubystyle.guide#assert-nil'
|
44
64
|
Enabled: true
|
45
65
|
VersionAdded: '0.1'
|
46
66
|
|
67
|
+
Minitest/AssertOutput:
|
68
|
+
Description: 'This cop checks for opportunities to use `assert_output`.'
|
69
|
+
StyleGuide: 'https://minitest.rubystyle.guide/#assert-output'
|
70
|
+
Enabled: 'pending'
|
71
|
+
VersionAdded: '0.10'
|
72
|
+
|
73
|
+
Minitest/AssertPathExists:
|
74
|
+
Description: 'This cop enforces the test to use `assert_path_exists` instead of using `assert(File.exist?(path))`.'
|
75
|
+
StyleGuide: 'https://minitest.rubystyle.guide/#assert-path-exists'
|
76
|
+
Enabled: 'pending'
|
77
|
+
VersionAdded: '0.10'
|
78
|
+
|
47
79
|
Minitest/AssertRespondTo:
|
48
|
-
Description: 'This cop enforces the test to use `assert_respond_to(object, :
|
49
|
-
StyleGuide: 'https://
|
80
|
+
Description: 'This cop enforces the test to use `assert_respond_to(object, :do_something)` over `assert(object.respond_to?(:do_something))`.'
|
81
|
+
StyleGuide: 'https://minitest.rubystyle.guide#assert-responds-to-method'
|
50
82
|
Enabled: true
|
51
83
|
VersionAdded: '0.3'
|
52
84
|
|
85
|
+
Minitest/AssertSilent:
|
86
|
+
Description: "This cop enforces the test to use `assert_silent { ... }` instead of using `assert_output('', '') { ... }`."
|
87
|
+
StyleGuide: 'https://github.com/rubocop-hq/minitest-style-guide#assert-silent'
|
88
|
+
Enabled: 'pending'
|
89
|
+
VersionAdded: '0.10'
|
90
|
+
|
53
91
|
Minitest/AssertTruthy:
|
54
92
|
Description: 'This cop enforces the test to use `assert(actual)` instead of using `assert_equal(true, actual)`.'
|
55
|
-
StyleGuide: 'https://
|
93
|
+
StyleGuide: 'https://minitest.rubystyle.guide#assert-truthy'
|
56
94
|
Enabled: true
|
57
95
|
VersionAdded: '0.2'
|
58
96
|
|
97
|
+
Minitest/GlobalExpectations:
|
98
|
+
Description: 'This cop checks for deprecated global expectations.'
|
99
|
+
StyleGuide: 'https://minitest.rubystyle.guide#global-expectations'
|
100
|
+
Enabled: true
|
101
|
+
VersionAdded: '0.7'
|
102
|
+
|
103
|
+
Minitest/LiteralAsActualArgument:
|
104
|
+
Description: 'This cop enforces correct order of `expected` and `actual` arguments for `assert_equal`.'
|
105
|
+
StyleGuide: 'https://minitest.rubystyle.guide/#assert-equal-arguments-order'
|
106
|
+
Enabled: 'pending'
|
107
|
+
VersionAdded: '0.10'
|
108
|
+
|
109
|
+
Minitest/MultipleAssertions:
|
110
|
+
Description: 'This cop checks if test cases contain too many assertion calls.'
|
111
|
+
Enabled: 'pending'
|
112
|
+
VersionAdded: '0.10'
|
113
|
+
Max: 3
|
114
|
+
|
59
115
|
Minitest/RefuteEmpty:
|
60
116
|
Description: 'This cop enforces to use `refute_empty` instead of using `refute(object.empty?)`.'
|
61
|
-
StyleGuide: 'https://
|
117
|
+
StyleGuide: 'https://minitest.rubystyle.guide#refute-empty'
|
62
118
|
Enabled: true
|
63
119
|
VersionAdded: '0.3'
|
64
120
|
|
65
121
|
Minitest/RefuteEqual:
|
66
122
|
Description: 'Check if your test uses `refute_equal` instead of `assert(expected != object)` or `assert(! expected == object))`.'
|
67
|
-
StyleGuide: 'https://
|
123
|
+
StyleGuide: 'https://minitest.rubystyle.guide#refute-equal'
|
68
124
|
Enabled: true
|
69
125
|
VersionAdded: '0.3'
|
70
126
|
|
71
127
|
Minitest/RefuteFalse:
|
72
128
|
Description: 'Check if your test uses `refute(actual)` instead of `assert_equal(false, actual)`.'
|
73
|
-
StyleGuide: 'https://
|
129
|
+
StyleGuide: 'https://minitest.rubystyle.guide#refute-false'
|
74
130
|
Enabled: true
|
75
131
|
VersionAdded: '0.3'
|
76
132
|
|
133
|
+
Minitest/RefuteInDelta:
|
134
|
+
Description: 'This cop enforces the test to use `refute_in_delta` instead of using `refute_equal` to compare floats.'
|
135
|
+
StyleGuide: 'https://minitest.rubystyle.guide/#refute-in-delta'
|
136
|
+
Enabled: 'pending'
|
137
|
+
VersionAdded: '0.10'
|
138
|
+
|
77
139
|
Minitest/RefuteIncludes:
|
78
140
|
Description: 'This cop enforces the test to use `refute_includes` instead of using `refute(collection.include?(object))`.'
|
79
|
-
StyleGuide: 'https://
|
141
|
+
StyleGuide: 'https://minitest.rubystyle.guide#refute-includes'
|
80
142
|
Enabled: true
|
81
143
|
VersionAdded: '0.3'
|
82
144
|
|
83
145
|
Minitest/RefuteMatch:
|
84
146
|
Description: 'This cop enforces the test to use `refute_match` instead of using `refute(matcher.match(object))`.'
|
85
|
-
StyleGuide: 'https://
|
147
|
+
StyleGuide: 'https://minitest.rubystyle.guide#refute-match'
|
86
148
|
Enabled: true
|
87
149
|
VersionAdded: '0.6'
|
88
150
|
|
89
151
|
Minitest/RefuteInstanceOf:
|
90
152
|
Description: 'This cop enforces the test to use `refute_instance_of(Class, object)` over `refute(object.instance_of?(Class))`.'
|
91
|
-
StyleGuide: 'https://
|
153
|
+
StyleGuide: 'https://minitest.rubystyle.guide#refute-instance-of'
|
92
154
|
Enabled: true
|
93
155
|
VersionAdded: '0.4'
|
94
156
|
|
157
|
+
Minitest/RefuteKindOf:
|
158
|
+
Description: 'This cop enforces the test to use `refute_kind_of(Class, object)` over `refute(object.kind_of?(Class))`.'
|
159
|
+
StyleGuide: 'https://github.com/rubocop-hq/minitest-style-guide#refute-kind-of'
|
160
|
+
Enabled: 'pending'
|
161
|
+
VersionAdded: '0.10'
|
162
|
+
|
95
163
|
Minitest/RefuteNil:
|
96
164
|
Description: 'This cop enforces the test to use `refute_nil` instead of using `refute_equal(nil, something)`.'
|
97
|
-
StyleGuide: 'https://
|
165
|
+
StyleGuide: 'https://minitest.rubystyle.guide#refute-nil'
|
98
166
|
Enabled: true
|
99
167
|
VersionAdded: '0.2'
|
100
168
|
|
169
|
+
Minitest/RefutePathExists:
|
170
|
+
Description: 'This cop enforces the test to use `refute_path_exists` instead of using `refute(File.exist?(path))`.'
|
171
|
+
StyleGuide: 'https://minitest.rubystyle.guide/#refute-path-exists'
|
172
|
+
Enabled: 'pending'
|
173
|
+
VersionAdded: '0.10'
|
174
|
+
|
101
175
|
Minitest/RefuteRespondTo:
|
102
|
-
Description: 'This cop enforces the test to use `refute_respond_to(object, :
|
103
|
-
StyleGuide: 'https://
|
176
|
+
Description: 'This cop enforces the test to use `refute_respond_to(object, :do_something)` over `refute(object.respond_to?(:do_something))`.'
|
177
|
+
StyleGuide: 'https://minitest.rubystyle.guide#refute-respond-to'
|
104
178
|
Enabled: true
|
105
179
|
VersionAdded: '0.4'
|
180
|
+
|
181
|
+
Minitest/TestMethodName:
|
182
|
+
Description: 'This cop enforces that test method names start with `test_` prefix.'
|
183
|
+
Enabled: 'pending'
|
184
|
+
VersionAdded: '0.10'
|
185
|
+
|
186
|
+
Minitest/UnspecifiedException:
|
187
|
+
Description: 'This cop checks for a specified error in `assert_raises`.'
|
188
|
+
StyleGuide: 'https://minitest.rubystyle.guide#unspecified-exception'
|
189
|
+
Enabled: 'pending'
|
190
|
+
VersionAdded: '0.10'
|
data/docs/antora.yml
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
// START_COP_LIST
|
2
|
+
|
3
|
+
= Department xref:cops_minitest.adoc[Minitest]
|
4
|
+
|
5
|
+
* xref:cops_minitest.adoc#minitestassertempty[Minitest/AssertEmpty]
|
6
|
+
* xref:cops_minitest.adoc#minitestassertemptyliteral[Minitest/AssertEmptyLiteral]
|
7
|
+
* xref:cops_minitest.adoc#minitestassertequal[Minitest/AssertEqual]
|
8
|
+
* xref:cops_minitest.adoc#minitestassertindelta[Minitest/AssertInDelta]
|
9
|
+
* xref:cops_minitest.adoc#minitestassertincludes[Minitest/AssertIncludes]
|
10
|
+
* xref:cops_minitest.adoc#minitestassertinstanceof[Minitest/AssertInstanceOf]
|
11
|
+
* xref:cops_minitest.adoc#minitestassertkindof[Minitest/AssertKindOf]
|
12
|
+
* xref:cops_minitest.adoc#minitestassertmatch[Minitest/AssertMatch]
|
13
|
+
* xref:cops_minitest.adoc#minitestassertnil[Minitest/AssertNil]
|
14
|
+
* xref:cops_minitest.adoc#minitestassertoutput[Minitest/AssertOutput]
|
15
|
+
* xref:cops_minitest.adoc#minitestassertpathexists[Minitest/AssertPathExists]
|
16
|
+
* xref:cops_minitest.adoc#minitestassertrespondto[Minitest/AssertRespondTo]
|
17
|
+
* xref:cops_minitest.adoc#minitestassertsilent[Minitest/AssertSilent]
|
18
|
+
* xref:cops_minitest.adoc#minitestasserttruthy[Minitest/AssertTruthy]
|
19
|
+
* xref:cops_minitest.adoc#minitestassertioninlifecyclehook[Minitest/AssertionInLifecycleHook]
|
20
|
+
* xref:cops_minitest.adoc#minitestglobalexpectations[Minitest/GlobalExpectations]
|
21
|
+
* xref:cops_minitest.adoc#minitestliteralasactualargument[Minitest/LiteralAsActualArgument]
|
22
|
+
* xref:cops_minitest.adoc#minitestmultipleassertions[Minitest/MultipleAssertions]
|
23
|
+
* xref:cops_minitest.adoc#minitestrefuteempty[Minitest/RefuteEmpty]
|
24
|
+
* xref:cops_minitest.adoc#minitestrefuteequal[Minitest/RefuteEqual]
|
25
|
+
* xref:cops_minitest.adoc#minitestrefutefalse[Minitest/RefuteFalse]
|
26
|
+
* xref:cops_minitest.adoc#minitestrefuteindelta[Minitest/RefuteInDelta]
|
27
|
+
* xref:cops_minitest.adoc#minitestrefuteincludes[Minitest/RefuteIncludes]
|
28
|
+
* xref:cops_minitest.adoc#minitestrefuteinstanceof[Minitest/RefuteInstanceOf]
|
29
|
+
* xref:cops_minitest.adoc#minitestrefutekindof[Minitest/RefuteKindOf]
|
30
|
+
* xref:cops_minitest.adoc#minitestrefutematch[Minitest/RefuteMatch]
|
31
|
+
* xref:cops_minitest.adoc#minitestrefutenil[Minitest/RefuteNil]
|
32
|
+
* xref:cops_minitest.adoc#minitestrefutepathexists[Minitest/RefutePathExists]
|
33
|
+
* xref:cops_minitest.adoc#minitestrefuterespondto[Minitest/RefuteRespondTo]
|
34
|
+
* xref:cops_minitest.adoc#minitesttestmethodname[Minitest/TestMethodName]
|
35
|
+
* xref:cops_minitest.adoc#minitestunspecifiedexception[Minitest/UnspecifiedException]
|
36
|
+
|
37
|
+
// END_COP_LIST
|