checkoff 0.223.0 → 0.226.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 +4 -4
- data/checkoff.gemspec +10 -5
- data/lib/checkoff/attachments.rb +1 -1
- data/lib/checkoff/cli.rb +1 -1
- data/lib/checkoff/clients.rb +1 -1
- data/lib/checkoff/custom_fields.rb +1 -1
- data/lib/checkoff/events.rb +1 -1
- data/lib/checkoff/internal/config_loader.rb +2 -3
- data/lib/checkoff/internal/selector_classes/section/function_evaluator.rb +3 -2
- data/lib/checkoff/my_tasks.rb +1 -1
- data/lib/checkoff/portfolios.rb +11 -9
- data/lib/checkoff/projects.rb +1 -1
- data/lib/checkoff/sections.rb +4 -5
- data/lib/checkoff/tags.rb +66 -17
- data/lib/checkoff/tasks.rb +1 -1
- data/lib/checkoff/version.rb +1 -1
- data/lib/checkoff/workspaces.rb +1 -1
- data/rbi/checkoff.rbi +4529 -0
- data/sig/checkoff.rbs +3749 -0
- metadata +5 -211
- data/.circleci/config.yml +0 -291
- data/.envrc +0 -9
- data/.git-hooks/pre_commit/circle_ci.rb +0 -26
- data/.git-hooks/pre_commit/punchlist.rb +0 -52
- data/.git-hooks/pre_commit/solargraph_typecheck.rb +0 -77
- data/.gitattributes +0 -6
- data/.gitignore +0 -65
- data/.markdownlint_style.rb +0 -4
- data/.mdlrc +0 -1
- data/.overcommit.yml +0 -115
- data/.rubocop.yml +0 -143
- data/.rubocop_todo.yml +0 -90
- data/.solargraph.yml +0 -35
- data/.yamllint.yml +0 -8
- data/.yardopts +0 -2
- data/CODE_OF_CONDUCT.md +0 -133
- data/CONTRIBUTING.rst +0 -75
- data/DEVELOPMENT.md +0 -69
- data/GLOSSARY.md +0 -16
- data/Gemfile +0 -67
- data/Gemfile.lock +0 -351
- data/LICENSE +0 -21
- data/Makefile +0 -139
- data/bin/brakeman +0 -27
- data/bin/bump +0 -29
- data/bin/checkoff +0 -29
- data/bin/console +0 -15
- data/bin/overcommit +0 -29
- data/bin/overcommit_branch +0 -114
- data/bin/rake +0 -29
- data/bin/rubocop +0 -27
- data/bin/setup +0 -8
- data/bin/solargraph +0 -27
- data/bin/sord +0 -27
- data/bin/spoom +0 -27
- data/bin/srb +0 -27
- data/bin/srb-rbi +0 -27
- data/bin/tapioca +0 -27
- data/bin/yard +0 -27
- data/config/annotations_asana.rb +0 -253
- data/config/annotations_misc.rb +0 -68
- data/config/env.1p +0 -2
- data/docs/.gitignore +0 -3
- data/docs/cookiecutter_input.json +0 -17
- data/docs/example_project.png +0 -0
- data/fix.sh +0 -534
- data/metrics/bigfiles_high_water_mark +0 -1
- data/metrics/brakeman_high_water_mark +0 -1
- data/metrics/bundle-audit_high_water_mark +0 -1
- data/metrics/cane_high_water_mark +0 -1
- data/metrics/eslint_high_water_mark +0 -1
- data/metrics/flake8_high_water_mark +0 -1
- data/metrics/flay_high_water_mark +0 -1
- data/metrics/flog_high_water_mark +0 -1
- data/metrics/jscs_high_water_mark +0 -1
- data/metrics/mdl_high_water_mark +0 -1
- data/metrics/pep8_high_water_mark +0 -1
- data/metrics/punchlist_high_water_mark +0 -1
- data/metrics/pycodestyle_high_water_mark +0 -1
- data/metrics/rails_best_practices_high_water_mark +0 -1
- data/metrics/rubocop_high_water_mark +0 -1
- data/metrics/scalastyle_high_water_mark +0 -1
- data/metrics/shellcheck_high_water_mark +0 -1
- data/package.json +0 -9
- data/rakelib/citest.rake +0 -4
- data/rakelib/clear_metrics.rake +0 -9
- data/rakelib/console.rake +0 -15
- data/rakelib/default.rake +0 -4
- data/rakelib/doc.rake +0 -6
- data/rakelib/gem_tasks.rake +0 -3
- data/rakelib/localtest.rake +0 -4
- data/rakelib/overcommit.rake +0 -6
- data/rakelib/quality.rake +0 -4
- data/rakelib/repl.rake +0 -4
- data/rakelib/test.rake +0 -10
- data/rakelib/trigger_next_builds.rake +0 -7
- data/rakelib/undercover.rake +0 -8
- data/requirements_dev.txt +0 -2
- data/sorbet/config +0 -4
- data/sorbet/rbi/annotations/.gitattributes +0 -1
- data/sorbet/rbi/annotations/activesupport.rbi +0 -453
- data/sorbet/rbi/annotations/faraday.rbi +0 -17
- data/sorbet/rbi/annotations/minitest.rbi +0 -119
- data/sorbet/rbi/annotations/mocha.rbi +0 -34
- data/sorbet/rbi/annotations/rainbow.rbi +0 -269
- data/sorbet/rbi/annotations/webmock.rbi +0 -9
- data/sorbet/rbi/dsl/.gitattributes +0 -1
- data/sorbet/rbi/dsl/active_support/callbacks.rbi +0 -23
- data/sorbet/rbi/gems/.gitattributes +0 -1
- data/sorbet/rbi/gems/activesupport@7.1.5.rbi +0 -18746
- data/sorbet/rbi/gems/addressable@2.8.6.rbi +0 -1994
- data/sorbet/rbi/gems/ansi@1.5.0.rbi +0 -688
- data/sorbet/rbi/gems/asana@0.10.6-ab9393136d9ca59b75e42a661fdddc1c65c8f7c3.rbi +0 -6142
- data/sorbet/rbi/gems/ast@2.4.2.rbi +0 -585
- data/sorbet/rbi/gems/backport@1.2.0.rbi +0 -523
- data/sorbet/rbi/gems/base64@0.2.0.rbi +0 -509
- data/sorbet/rbi/gems/benchmark@0.4.0.rbi +0 -618
- data/sorbet/rbi/gems/bigdecimal@3.1.5.rbi +0 -78
- data/sorbet/rbi/gems/brakeman@6.2.2.rbi +0 -222
- data/sorbet/rbi/gems/builder@3.2.4.rbi +0 -505
- data/sorbet/rbi/gems/bump@0.10.0.rbi +0 -169
- data/sorbet/rbi/gems/cache@0.4.1.rbi +0 -211
- data/sorbet/rbi/gems/cache_method@0.2.7.rbi +0 -293
- data/sorbet/rbi/gems/chef-utils@18.3.0.rbi +0 -9
- data/sorbet/rbi/gems/childprocess@5.1.0.rbi +0 -383
- data/sorbet/rbi/gems/coderay@1.1.3.rbi +0 -3427
- data/sorbet/rbi/gems/commander@4.6.0.rbi +0 -9
- data/sorbet/rbi/gems/concurrent-ruby@1.2.3.rbi +0 -11591
- data/sorbet/rbi/gems/connection_pool@2.4.1.rbi +0 -9
- data/sorbet/rbi/gems/crack@0.4.5.rbi +0 -145
- data/sorbet/rbi/gems/diff-lcs@1.5.1.rbi +0 -969
- data/sorbet/rbi/gems/docile@1.4.0.rbi +0 -377
- data/sorbet/rbi/gems/drb@2.2.1.rbi +0 -1347
- data/sorbet/rbi/gems/e2mmap@0.1.0.rbi +0 -9
- data/sorbet/rbi/gems/erubi@1.13.0.rbi +0 -152
- data/sorbet/rbi/gems/faraday-em_http@1.0.0.rbi +0 -222
- data/sorbet/rbi/gems/faraday-em_synchrony@1.0.0.rbi +0 -126
- data/sorbet/rbi/gems/faraday-excon@1.1.0.rbi +0 -136
- data/sorbet/rbi/gems/faraday-httpclient@1.0.1.rbi +0 -145
- data/sorbet/rbi/gems/faraday-multipart@1.0.4.rbi +0 -259
- data/sorbet/rbi/gems/faraday-net_http@1.0.1.rbi +0 -142
- data/sorbet/rbi/gems/faraday-net_http_persistent@1.2.0.rbi +0 -118
- data/sorbet/rbi/gems/faraday-patron@1.0.0.rbi +0 -125
- data/sorbet/rbi/gems/faraday-rack@1.0.0.rbi +0 -133
- data/sorbet/rbi/gems/faraday-retry@1.0.3.rbi +0 -198
- data/sorbet/rbi/gems/faraday@1.10.3.rbi +0 -2729
- data/sorbet/rbi/gems/faraday_middleware-multi_json@0.0.6.rbi +0 -29
- data/sorbet/rbi/gems/faraday_middleware@1.2.0.rbi +0 -1004
- data/sorbet/rbi/gems/gli@2.22.0.rbi +0 -9
- data/sorbet/rbi/gems/hashdiff@1.0.1.rbi +0 -351
- data/sorbet/rbi/gems/highline@2.0.3.rbi +0 -9
- data/sorbet/rbi/gems/i18n@1.14.6.rbi +0 -2359
- data/sorbet/rbi/gems/imagen@0.1.8.rbi +0 -340
- data/sorbet/rbi/gems/iniparse@1.5.0.rbi +0 -899
- data/sorbet/rbi/gems/jaro_winkler@1.6.0.rbi +0 -22
- data/sorbet/rbi/gems/json@2.7.1.rbi +0 -1562
- data/sorbet/rbi/gems/jwt@2.7.1.rbi +0 -1405
- data/sorbet/rbi/gems/kramdown-parser-gfm@1.1.0.rbi +0 -128
- data/sorbet/rbi/gems/kramdown@2.4.0.rbi +0 -3272
- data/sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi +0 -14238
- data/sorbet/rbi/gems/logger@1.6.2.rbi +0 -923
- data/sorbet/rbi/gems/mdl@0.13.0.rbi +0 -445
- data/sorbet/rbi/gems/method_source@1.0.0.rbi +0 -273
- data/sorbet/rbi/gems/mime-types-data@3.2023.1205.rbi +0 -127
- data/sorbet/rbi/gems/mime-types@3.5.1.rbi +0 -1252
- data/sorbet/rbi/gems/minitest-profile@0.0.2.rbi +0 -136
- data/sorbet/rbi/gems/minitest-reporters@1.6.1.rbi +0 -1014
- data/sorbet/rbi/gems/minitest@5.21.1.rbi +0 -1539
- data/sorbet/rbi/gems/mixlib-cli@2.1.8.rbi +0 -314
- data/sorbet/rbi/gems/mixlib-config@3.0.27.rbi +0 -581
- data/sorbet/rbi/gems/mixlib-shellout@3.2.7.rbi +0 -629
- data/sorbet/rbi/gems/mocha@2.1.0.rbi +0 -12
- data/sorbet/rbi/gems/multi_json@1.15.0.rbi +0 -268
- data/sorbet/rbi/gems/multi_xml@0.6.0.rbi +0 -102
- data/sorbet/rbi/gems/multipart-post@2.3.0.rbi +0 -234
- data/sorbet/rbi/gems/mutex_m@0.3.0.rbi +0 -97
- data/sorbet/rbi/gems/netrc@0.11.0.rbi +0 -159
- data/sorbet/rbi/gems/nokogiri@1.17.0.rbi +0 -8201
- data/sorbet/rbi/gems/oauth2@1.4.11.rbi +0 -833
- data/sorbet/rbi/gems/overcommit@0.64.1.rbi +0 -2400
- data/sorbet/rbi/gems/parallel@1.23.0.rbi +0 -274
- data/sorbet/rbi/gems/parlour@5.0.0.rbi +0 -3007
- data/sorbet/rbi/gems/parser@3.2.2.4.rbi +0 -7253
- data/sorbet/rbi/gems/prism@1.2.0.rbi +0 -39085
- data/sorbet/rbi/gems/pry@0.14.2.rbi +0 -10070
- data/sorbet/rbi/gems/public_suffix@5.0.4.rbi +0 -936
- data/sorbet/rbi/gems/punchlist@1.3.2.rbi +0 -173
- data/sorbet/rbi/gems/racc@1.8.1.rbi +0 -162
- data/sorbet/rbi/gems/rack@3.1.8.rbi +0 -4896
- data/sorbet/rbi/gems/rainbow@3.1.1.rbi +0 -403
- data/sorbet/rbi/gems/rake@13.1.0.rbi +0 -3022
- data/sorbet/rbi/gems/rbi@0.2.1.rbi +0 -4535
- data/sorbet/rbi/gems/rbs@2.8.4.rbi +0 -5613
- data/sorbet/rbi/gems/regexp_parser@2.8.3.rbi +0 -3750
- data/sorbet/rbi/gems/reverse_markdown@2.1.1.rbi +0 -390
- data/sorbet/rbi/gems/rexml@3.3.9.rbi +0 -4964
- data/sorbet/rbi/gems/rubocop-ast@1.30.0.rbi +0 -7127
- data/sorbet/rbi/gems/rubocop-minitest@0.34.5.rbi +0 -2577
- data/sorbet/rbi/gems/rubocop-performance@1.20.2.rbi +0 -3262
- data/sorbet/rbi/gems/rubocop-rake@0.6.0.rbi +0 -329
- data/sorbet/rbi/gems/rubocop-rspec@3.0.0.rbi +0 -7546
- data/sorbet/rbi/gems/rubocop@1.59.0.rbi +0 -57238
- data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +0 -1318
- data/sorbet/rbi/gems/ruby2_keywords@0.0.5.rbi +0 -9
- data/sorbet/rbi/gems/rugged@1.6.3.rbi +0 -1577
- data/sorbet/rbi/gems/securerandom@0.4.0.rbi +0 -75
- data/sorbet/rbi/gems/simplecov-html@0.12.3.rbi +0 -217
- data/sorbet/rbi/gems/simplecov-lcov@0.8.0.rbi +0 -256
- data/sorbet/rbi/gems/simplecov@0.22.0.rbi +0 -2149
- data/sorbet/rbi/gems/simplecov_json_formatter@0.1.4.rbi +0 -9
- data/sorbet/rbi/gems/solargraph-rails@1.1.0-9dc37915bd4f3b169046e34db6fb32193ab347d8.rbi +0 -320
- data/sorbet/rbi/gems/solargraph@0.50.1-904b9304770a59fac393c5cc3cad481e5bdf0fd8.rbi +0 -9396
- data/sorbet/rbi/gems/sord@5.1.0.rbi +0 -820
- data/sorbet/rbi/gems/source_finder@3.2.1.rbi +0 -317
- data/sorbet/rbi/gems/spoom@1.5.0.rbi +0 -4932
- data/sorbet/rbi/gems/tapioca@0.16.5.rbi +0 -3617
- data/sorbet/rbi/gems/thor@1.3.2.rbi +0 -4378
- data/sorbet/rbi/gems/tilt@2.4.0.rbi +0 -933
- data/sorbet/rbi/gems/tomlrb@2.0.3.rbi +0 -9
- data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +0 -5918
- data/sorbet/rbi/gems/undercover@0.5.0.rbi +0 -433
- data/sorbet/rbi/gems/unicode-display_width@2.5.0.rbi +0 -66
- data/sorbet/rbi/gems/webmock@3.19.1.rbi +0 -1769
- data/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi +0 -435
- data/sorbet/rbi/gems/yard@0.9.37.rbi +0 -18406
- data/sorbet/rbi/todo.rbi +0 -11
- data/sorbet/tapioca/config.yml +0 -13
- data/sorbet/tapioca/require.rb +0 -4
@@ -1,2577 +0,0 @@
|
|
1
|
-
# typed: true
|
2
|
-
|
3
|
-
# DO NOT EDIT MANUALLY
|
4
|
-
# This is an autogenerated file for types exported from the `rubocop-minitest` gem.
|
5
|
-
# Please instead update this file by running `bin/tapioca gem rubocop-minitest`.
|
6
|
-
|
7
|
-
|
8
|
-
# source://rubocop-minitest//lib/rubocop/minitest.rb#3
|
9
|
-
module RuboCop; end
|
10
|
-
|
11
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/argument_range_helper.rb#4
|
12
|
-
module RuboCop::Cop; end
|
13
|
-
|
14
|
-
# Methods that calculate and return `Parser::Source::Ranges`.
|
15
|
-
#
|
16
|
-
# @api private
|
17
|
-
#
|
18
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/argument_range_helper.rb#7
|
19
|
-
module RuboCop::Cop::ArgumentRangeHelper
|
20
|
-
include ::RuboCop::Cop::RangeHelp
|
21
|
-
|
22
|
-
private
|
23
|
-
|
24
|
-
# @api private
|
25
|
-
#
|
26
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/argument_range_helper.rb#19
|
27
|
-
def all_arguments_range(node); end
|
28
|
-
|
29
|
-
# @api private
|
30
|
-
#
|
31
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/argument_range_helper.rb#12
|
32
|
-
def first_and_second_arguments_range(node); end
|
33
|
-
end
|
34
|
-
|
35
|
-
# Common functionality for `AssertInDelta` and `RefuteInDelta` cops.
|
36
|
-
#
|
37
|
-
# @api private
|
38
|
-
#
|
39
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/in_delta_mixin.rb#7
|
40
|
-
module RuboCop::Cop::InDeltaMixin
|
41
|
-
# @api private
|
42
|
-
#
|
43
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/in_delta_mixin.rb#10
|
44
|
-
def on_send(node); end
|
45
|
-
|
46
|
-
private
|
47
|
-
|
48
|
-
# @api private
|
49
|
-
#
|
50
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/in_delta_mixin.rb#35
|
51
|
-
def assertion_method; end
|
52
|
-
|
53
|
-
# @api private
|
54
|
-
#
|
55
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/in_delta_mixin.rb#27
|
56
|
-
def build_good_method(expected, actual, message); end
|
57
|
-
end
|
58
|
-
|
59
|
-
# @api private
|
60
|
-
#
|
61
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/in_delta_mixin.rb#8
|
62
|
-
RuboCop::Cop::InDeltaMixin::MSG = T.let(T.unsafe(nil), String)
|
63
|
-
|
64
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/instance_of_assertion_handleable.rb#5
|
65
|
-
module RuboCop::Cop::Minitest; end
|
66
|
-
|
67
|
-
# Enforces the test to use `assert_empty` instead of using `assert(object.empty?)`.
|
68
|
-
#
|
69
|
-
# @example
|
70
|
-
# # bad
|
71
|
-
# assert(object.empty?)
|
72
|
-
# assert(object.empty?, 'message')
|
73
|
-
#
|
74
|
-
# # good
|
75
|
-
# assert_empty(object)
|
76
|
-
# assert_empty(object, 'message')
|
77
|
-
#
|
78
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_empty.rb#17
|
79
|
-
class RuboCop::Cop::Minitest::AssertEmpty < ::RuboCop::Cop::Base
|
80
|
-
include ::RuboCop::Cop::RangeHelp
|
81
|
-
include ::RuboCop::Cop::ArgumentRangeHelper
|
82
|
-
extend ::RuboCop::Cop::MinitestCopRule
|
83
|
-
extend ::RuboCop::Cop::AutoCorrector
|
84
|
-
|
85
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#57
|
86
|
-
def autocorrect(corrector, node, arguments); end
|
87
|
-
|
88
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_empty.rb#23
|
89
|
-
def on_send(node); end
|
90
|
-
|
91
|
-
private
|
92
|
-
|
93
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#95
|
94
|
-
def correct_receiver(receiver); end
|
95
|
-
|
96
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#81
|
97
|
-
def new_arguments(arguments); end
|
98
|
-
|
99
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#67
|
100
|
-
def offense_message(arguments); end
|
101
|
-
end
|
102
|
-
|
103
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#43
|
104
|
-
RuboCop::Cop::Minitest::AssertEmpty::MSG = T.let(T.unsafe(nil), String)
|
105
|
-
|
106
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#44
|
107
|
-
RuboCop::Cop::Minitest::AssertEmpty::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
108
|
-
|
109
|
-
# Enforces the test to use `assert_empty`
|
110
|
-
# instead of using `assert_equal([], object)` or `assert_equal({}, object)`.
|
111
|
-
#
|
112
|
-
# @example
|
113
|
-
# # bad
|
114
|
-
# assert_equal([], object)
|
115
|
-
# assert_equal({}, object)
|
116
|
-
#
|
117
|
-
# # good
|
118
|
-
# assert_empty(object)
|
119
|
-
#
|
120
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_empty_literal.rb#17
|
121
|
-
class RuboCop::Cop::Minitest::AssertEmptyLiteral < ::RuboCop::Cop::Base
|
122
|
-
include ::RuboCop::Cop::RangeHelp
|
123
|
-
include ::RuboCop::Cop::ArgumentRangeHelper
|
124
|
-
extend ::RuboCop::Cop::AutoCorrector
|
125
|
-
|
126
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_empty_literal.rb#24
|
127
|
-
def assert_equal_with_empty_literal(param0 = T.unsafe(nil)); end
|
128
|
-
|
129
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_empty_literal.rb#28
|
130
|
-
def on_send(node); end
|
131
|
-
end
|
132
|
-
|
133
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_empty_literal.rb#21
|
134
|
-
RuboCop::Cop::Minitest::AssertEmptyLiteral::MSG = T.let(T.unsafe(nil), String)
|
135
|
-
|
136
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_empty_literal.rb#22
|
137
|
-
RuboCop::Cop::Minitest::AssertEmptyLiteral::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
138
|
-
|
139
|
-
# Enforces the use of `assert_equal(expected, actual)`
|
140
|
-
# over `assert(expected == actual)`.
|
141
|
-
#
|
142
|
-
# @example
|
143
|
-
# # bad
|
144
|
-
# assert("rubocop-minitest" == actual)
|
145
|
-
# assert_operator("rubocop-minitest", :==, actual)
|
146
|
-
#
|
147
|
-
# # good
|
148
|
-
# assert_equal("rubocop-minitest", actual)
|
149
|
-
#
|
150
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_equal.rb#17
|
151
|
-
class RuboCop::Cop::Minitest::AssertEqual < ::RuboCop::Cop::Base
|
152
|
-
include ::RuboCop::Cop::RangeHelp
|
153
|
-
include ::RuboCop::Cop::ArgumentRangeHelper
|
154
|
-
extend ::RuboCop::Cop::AutoCorrector
|
155
|
-
|
156
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_equal.rb#24
|
157
|
-
def assert_equal(param0 = T.unsafe(nil)); end
|
158
|
-
|
159
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_equal.rb#32
|
160
|
-
def on_send(node); end
|
161
|
-
end
|
162
|
-
|
163
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_equal.rb#21
|
164
|
-
RuboCop::Cop::Minitest::AssertEqual::MSG = T.let(T.unsafe(nil), String)
|
165
|
-
|
166
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_equal.rb#22
|
167
|
-
RuboCop::Cop::Minitest::AssertEqual::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
168
|
-
|
169
|
-
# Enforces the test to use `assert_in_delta`
|
170
|
-
# instead of using `assert_equal` to compare floats.
|
171
|
-
#
|
172
|
-
# @example
|
173
|
-
# # bad
|
174
|
-
# assert_equal(0.2, actual)
|
175
|
-
# assert_equal(0.2, actual, 'message')
|
176
|
-
#
|
177
|
-
# # good
|
178
|
-
# assert_in_delta(0.2, actual)
|
179
|
-
# assert_in_delta(0.2, actual, 0.001, 'message')
|
180
|
-
#
|
181
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_in_delta.rb#18
|
182
|
-
class RuboCop::Cop::Minitest::AssertInDelta < ::RuboCop::Cop::Base
|
183
|
-
include ::RuboCop::Cop::InDeltaMixin
|
184
|
-
extend ::RuboCop::Cop::AutoCorrector
|
185
|
-
|
186
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_in_delta.rb#24
|
187
|
-
def equal_floats_call(param0 = T.unsafe(nil)); end
|
188
|
-
end
|
189
|
-
|
190
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_in_delta.rb#22
|
191
|
-
RuboCop::Cop::Minitest::AssertInDelta::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
192
|
-
|
193
|
-
# Enforces the test to use `assert_includes`
|
194
|
-
# instead of using `assert(collection.include?(object))`.
|
195
|
-
#
|
196
|
-
# @example
|
197
|
-
# # bad
|
198
|
-
# assert(collection.include?(object))
|
199
|
-
# assert(collection.include?(object), 'message')
|
200
|
-
#
|
201
|
-
# # good
|
202
|
-
# assert_includes(collection, object)
|
203
|
-
# assert_includes(collection, object, 'message')
|
204
|
-
#
|
205
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_includes.rb#18
|
206
|
-
class RuboCop::Cop::Minitest::AssertIncludes < ::RuboCop::Cop::Base
|
207
|
-
include ::RuboCop::Cop::RangeHelp
|
208
|
-
include ::RuboCop::Cop::ArgumentRangeHelper
|
209
|
-
extend ::RuboCop::Cop::MinitestCopRule
|
210
|
-
extend ::RuboCop::Cop::AutoCorrector
|
211
|
-
|
212
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#57
|
213
|
-
def autocorrect(corrector, node, arguments); end
|
214
|
-
|
215
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#46
|
216
|
-
def on_send(node); end
|
217
|
-
|
218
|
-
private
|
219
|
-
|
220
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#95
|
221
|
-
def correct_receiver(receiver); end
|
222
|
-
|
223
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#81
|
224
|
-
def new_arguments(arguments); end
|
225
|
-
|
226
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#67
|
227
|
-
def offense_message(arguments); end
|
228
|
-
end
|
229
|
-
|
230
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#43
|
231
|
-
RuboCop::Cop::Minitest::AssertIncludes::MSG = T.let(T.unsafe(nil), String)
|
232
|
-
|
233
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#44
|
234
|
-
RuboCop::Cop::Minitest::AssertIncludes::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
235
|
-
|
236
|
-
# Enforces the test to use `assert_instance_of(Class, object)`
|
237
|
-
# over `assert(object.instance_of?(Class))`.
|
238
|
-
#
|
239
|
-
# @example
|
240
|
-
# # bad
|
241
|
-
# assert(object.instance_of?(Class))
|
242
|
-
# assert(object.instance_of?(Class), 'message')
|
243
|
-
#
|
244
|
-
# # bad
|
245
|
-
# assert_equal(Class, object.class)
|
246
|
-
# assert_equal(Class, object.class, 'message')
|
247
|
-
#
|
248
|
-
# # good
|
249
|
-
# assert_instance_of(Class, object)
|
250
|
-
# assert_instance_of(Class, object, 'message')
|
251
|
-
#
|
252
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_instance_of.rb#22
|
253
|
-
class RuboCop::Cop::Minitest::AssertInstanceOf < ::RuboCop::Cop::Base
|
254
|
-
include ::RuboCop::Cop::RangeHelp
|
255
|
-
include ::RuboCop::Cop::ArgumentRangeHelper
|
256
|
-
include ::RuboCop::Cop::Minitest::InstanceOfAssertionHandleable
|
257
|
-
extend ::RuboCop::Cop::AutoCorrector
|
258
|
-
|
259
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_instance_of.rb#28
|
260
|
-
def instance_of_assertion?(param0 = T.unsafe(nil)); end
|
261
|
-
|
262
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_instance_of.rb#35
|
263
|
-
def on_send(node); end
|
264
|
-
end
|
265
|
-
|
266
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_instance_of.rb#26
|
267
|
-
RuboCop::Cop::Minitest::AssertInstanceOf::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
268
|
-
|
269
|
-
# Enforces the test to use `assert_kind_of(Class, object)`
|
270
|
-
# over `assert(object.kind_of?(Class))`.
|
271
|
-
#
|
272
|
-
# @example
|
273
|
-
# # bad
|
274
|
-
# assert(object.kind_of?(Class))
|
275
|
-
# assert(object.kind_of?(Class), 'message')
|
276
|
-
#
|
277
|
-
# # bad
|
278
|
-
# # `is_a?` is an alias for `kind_of?`
|
279
|
-
# assert(object.is_a?(Class))
|
280
|
-
# assert(object.is_a?(Class), 'message')
|
281
|
-
#
|
282
|
-
# # good
|
283
|
-
# assert_kind_of(Class, object)
|
284
|
-
# assert_kind_of(Class, object, 'message')
|
285
|
-
#
|
286
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_kind_of.rb#23
|
287
|
-
class RuboCop::Cop::Minitest::AssertKindOf < ::RuboCop::Cop::Base
|
288
|
-
include ::RuboCop::Cop::RangeHelp
|
289
|
-
include ::RuboCop::Cop::ArgumentRangeHelper
|
290
|
-
extend ::RuboCop::Cop::MinitestCopRule
|
291
|
-
extend ::RuboCop::Cop::AutoCorrector
|
292
|
-
|
293
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#57
|
294
|
-
def autocorrect(corrector, node, arguments); end
|
295
|
-
|
296
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#46
|
297
|
-
def on_send(node); end
|
298
|
-
|
299
|
-
private
|
300
|
-
|
301
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#95
|
302
|
-
def correct_receiver(receiver); end
|
303
|
-
|
304
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#81
|
305
|
-
def new_arguments(arguments); end
|
306
|
-
|
307
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#67
|
308
|
-
def offense_message(arguments); end
|
309
|
-
end
|
310
|
-
|
311
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#43
|
312
|
-
RuboCop::Cop::Minitest::AssertKindOf::MSG = T.let(T.unsafe(nil), String)
|
313
|
-
|
314
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#44
|
315
|
-
RuboCop::Cop::Minitest::AssertKindOf::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
316
|
-
|
317
|
-
# Enforces the test to use `assert_match`
|
318
|
-
# instead of using `assert(matcher.match(string))`.
|
319
|
-
#
|
320
|
-
# @example
|
321
|
-
# # bad
|
322
|
-
# assert(matcher.match(string))
|
323
|
-
# assert(matcher.match?(string))
|
324
|
-
# assert(matcher =~ string)
|
325
|
-
# assert_operator(matcher, :=~, string)
|
326
|
-
# assert(matcher.match(string), 'message')
|
327
|
-
#
|
328
|
-
# # good
|
329
|
-
# assert_match(regex, string)
|
330
|
-
# assert_match(matcher, string, 'message')
|
331
|
-
#
|
332
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_match.rb#21
|
333
|
-
class RuboCop::Cop::Minitest::AssertMatch < ::RuboCop::Cop::Base
|
334
|
-
include ::RuboCop::Cop::RangeHelp
|
335
|
-
include ::RuboCop::Cop::ArgumentRangeHelper
|
336
|
-
extend ::RuboCop::Cop::AutoCorrector
|
337
|
-
|
338
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_match.rb#28
|
339
|
-
def assert_match(param0 = T.unsafe(nil)); end
|
340
|
-
|
341
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_match.rb#36
|
342
|
-
def on_send(node); end
|
343
|
-
|
344
|
-
private
|
345
|
-
|
346
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_match.rb#59
|
347
|
-
def order_expected_and_actual(expected, actual); end
|
348
|
-
end
|
349
|
-
|
350
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_match.rb#25
|
351
|
-
RuboCop::Cop::Minitest::AssertMatch::MSG = T.let(T.unsafe(nil), String)
|
352
|
-
|
353
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_match.rb#26
|
354
|
-
RuboCop::Cop::Minitest::AssertMatch::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
355
|
-
|
356
|
-
# Enforces the test to use `assert_nil` instead of using
|
357
|
-
# `assert_equal(nil, something)`, `assert(something.nil?)`, or `assert_predicate(something, :nil?)`.
|
358
|
-
#
|
359
|
-
# @example
|
360
|
-
# # bad
|
361
|
-
# assert_equal(nil, actual)
|
362
|
-
# assert_equal(nil, actual, 'message')
|
363
|
-
# assert(object.nil?)
|
364
|
-
# assert(object.nil?, 'message')
|
365
|
-
# assert_predicate(object, :nil?)
|
366
|
-
# assert_predicate(object, :nil?, 'message')
|
367
|
-
#
|
368
|
-
# # good
|
369
|
-
# assert_nil(actual)
|
370
|
-
# assert_nil(actual, 'message')
|
371
|
-
#
|
372
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_nil.rb#22
|
373
|
-
class RuboCop::Cop::Minitest::AssertNil < ::RuboCop::Cop::Base
|
374
|
-
include ::RuboCop::Cop::RangeHelp
|
375
|
-
include ::RuboCop::Cop::ArgumentRangeHelper
|
376
|
-
include ::RuboCop::Cop::Minitest::NilAssertionHandleable
|
377
|
-
extend ::RuboCop::Cop::AutoCorrector
|
378
|
-
|
379
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_nil.rb#30
|
380
|
-
def nil_assertion(param0 = T.unsafe(nil)); end
|
381
|
-
|
382
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_nil.rb#38
|
383
|
-
def on_send(node); end
|
384
|
-
|
385
|
-
private
|
386
|
-
|
387
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_nil.rb#46
|
388
|
-
def assertion_type; end
|
389
|
-
end
|
390
|
-
|
391
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_nil.rb#27
|
392
|
-
RuboCop::Cop::Minitest::AssertNil::ASSERTION_TYPE = T.let(T.unsafe(nil), String)
|
393
|
-
|
394
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_nil.rb#28
|
395
|
-
RuboCop::Cop::Minitest::AssertNil::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
396
|
-
|
397
|
-
# Enforces the use of `assert_operator(expected, :<, actual)` over `assert(expected < actual)`.
|
398
|
-
#
|
399
|
-
# @example
|
400
|
-
#
|
401
|
-
# # bad
|
402
|
-
# assert(expected < actual)
|
403
|
-
#
|
404
|
-
# # good
|
405
|
-
# assert_operator(expected, :<, actual)
|
406
|
-
#
|
407
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_operator.rb#16
|
408
|
-
class RuboCop::Cop::Minitest::AssertOperator < ::RuboCop::Cop::Base
|
409
|
-
extend ::RuboCop::Cop::AutoCorrector
|
410
|
-
|
411
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_operator.rb#23
|
412
|
-
def on_send(node); end
|
413
|
-
|
414
|
-
private
|
415
|
-
|
416
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_operator.rb#41
|
417
|
-
def build_new_arguments(node); end
|
418
|
-
|
419
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_operator.rb#52
|
420
|
-
def range_of_arguments(node); end
|
421
|
-
end
|
422
|
-
|
423
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_operator.rb#21
|
424
|
-
RuboCop::Cop::Minitest::AssertOperator::ALLOWED_OPERATORS = T.let(T.unsafe(nil), Array)
|
425
|
-
|
426
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_operator.rb#19
|
427
|
-
RuboCop::Cop::Minitest::AssertOperator::MSG = T.let(T.unsafe(nil), String)
|
428
|
-
|
429
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_operator.rb#20
|
430
|
-
RuboCop::Cop::Minitest::AssertOperator::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
431
|
-
|
432
|
-
# Checks for opportunities to use `assert_output`.
|
433
|
-
#
|
434
|
-
# @example
|
435
|
-
# # bad
|
436
|
-
# $stdout = StringIO.new
|
437
|
-
# puts object.method
|
438
|
-
# $stdout.rewind
|
439
|
-
# assert_match expected, $stdout.read
|
440
|
-
#
|
441
|
-
# # good
|
442
|
-
# assert_output(expected) { puts object.method }
|
443
|
-
#
|
444
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_output.rb#18
|
445
|
-
class RuboCop::Cop::Minitest::AssertOutput < ::RuboCop::Cop::Base
|
446
|
-
include ::RuboCop::Cop::VisibilityHelp
|
447
|
-
include ::RuboCop::Cop::DefNode
|
448
|
-
include ::RuboCop::Cop::MinitestExplorationHelpers
|
449
|
-
|
450
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_output.rb#24
|
451
|
-
def on_gvasgn(node); end
|
452
|
-
|
453
|
-
private
|
454
|
-
|
455
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_output.rb#38
|
456
|
-
def find_test_case(node); end
|
457
|
-
|
458
|
-
# @return [Boolean]
|
459
|
-
#
|
460
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_output.rb#42
|
461
|
-
def references_gvar?(assertion, gvar_name); end
|
462
|
-
end
|
463
|
-
|
464
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_output.rb#21
|
465
|
-
RuboCop::Cop::Minitest::AssertOutput::MSG = T.let(T.unsafe(nil), String)
|
466
|
-
|
467
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_output.rb#22
|
468
|
-
RuboCop::Cop::Minitest::AssertOutput::OUTPUT_GLOBAL_VARIABLES = T.let(T.unsafe(nil), Array)
|
469
|
-
|
470
|
-
# Enforces the test to use `assert_path_exists` instead of using `assert(File.exist?(path))`.
|
471
|
-
#
|
472
|
-
# @example
|
473
|
-
# # bad
|
474
|
-
# assert(File.exist?(path))
|
475
|
-
# assert(File.exist?(path), 'message')
|
476
|
-
#
|
477
|
-
# # good
|
478
|
-
# assert_path_exists(path)
|
479
|
-
# assert_path_exists(path, 'message')
|
480
|
-
#
|
481
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_path_exists.rb#17
|
482
|
-
class RuboCop::Cop::Minitest::AssertPathExists < ::RuboCop::Cop::Base
|
483
|
-
extend ::RuboCop::Cop::AutoCorrector
|
484
|
-
|
485
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_path_exists.rb#23
|
486
|
-
def assert_file_exists(param0 = T.unsafe(nil)); end
|
487
|
-
|
488
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_path_exists.rb#30
|
489
|
-
def on_send(node); end
|
490
|
-
|
491
|
-
private
|
492
|
-
|
493
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_path_exists.rb#45
|
494
|
-
def build_good_method(node, path, message); end
|
495
|
-
end
|
496
|
-
|
497
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_path_exists.rb#20
|
498
|
-
RuboCop::Cop::Minitest::AssertPathExists::MSG = T.let(T.unsafe(nil), String)
|
499
|
-
|
500
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_path_exists.rb#21
|
501
|
-
RuboCop::Cop::Minitest::AssertPathExists::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
502
|
-
|
503
|
-
# Enforces the test to use `assert_predicate`
|
504
|
-
# instead of using `assert(obj.a_predicate_method?)`.
|
505
|
-
#
|
506
|
-
# @example
|
507
|
-
# # bad
|
508
|
-
# assert(obj.one?)
|
509
|
-
# assert(obj.one?, 'message')
|
510
|
-
#
|
511
|
-
# # good
|
512
|
-
# assert_predicate(obj, :one?)
|
513
|
-
# assert_predicate(obj, :one?, 'message')
|
514
|
-
#
|
515
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_predicate.rb#18
|
516
|
-
class RuboCop::Cop::Minitest::AssertPredicate < ::RuboCop::Cop::Base
|
517
|
-
include ::RuboCop::Cop::RangeHelp
|
518
|
-
include ::RuboCop::Cop::ArgumentRangeHelper
|
519
|
-
include ::RuboCop::Cop::Minitest::PredicateAssertionHandleable
|
520
|
-
extend ::RuboCop::Cop::AutoCorrector
|
521
|
-
|
522
|
-
private
|
523
|
-
|
524
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_predicate.rb#28
|
525
|
-
def assertion_type; end
|
526
|
-
end
|
527
|
-
|
528
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_predicate.rb#23
|
529
|
-
RuboCop::Cop::Minitest::AssertPredicate::MSG = T.let(T.unsafe(nil), String)
|
530
|
-
|
531
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_predicate.rb#24
|
532
|
-
RuboCop::Cop::Minitest::AssertPredicate::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
533
|
-
|
534
|
-
# Enforces the block body of `assert_raises { ... }` to be reduced to only the raising code.
|
535
|
-
#
|
536
|
-
# @example
|
537
|
-
# # bad
|
538
|
-
# assert_raises(MyError) do
|
539
|
-
# foo
|
540
|
-
# bar
|
541
|
-
# end
|
542
|
-
#
|
543
|
-
# # good
|
544
|
-
# assert_raises(MyError) do
|
545
|
-
# foo
|
546
|
-
# end
|
547
|
-
#
|
548
|
-
# # good
|
549
|
-
# assert_raises(MyError) do
|
550
|
-
# foo do
|
551
|
-
# bar
|
552
|
-
# baz
|
553
|
-
# end
|
554
|
-
# end
|
555
|
-
#
|
556
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_raises_compound_body.rb#28
|
557
|
-
class RuboCop::Cop::Minitest::AssertRaisesCompoundBody < ::RuboCop::Cop::Base
|
558
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_raises_compound_body.rb#31
|
559
|
-
def on_block(node); end
|
560
|
-
|
561
|
-
private
|
562
|
-
|
563
|
-
# @return [Boolean]
|
564
|
-
#
|
565
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_raises_compound_body.rb#39
|
566
|
-
def multi_statement_begin?(node); end
|
567
|
-
end
|
568
|
-
|
569
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_raises_compound_body.rb#29
|
570
|
-
RuboCop::Cop::Minitest::AssertRaisesCompoundBody::MSG = T.let(T.unsafe(nil), String)
|
571
|
-
|
572
|
-
# Checks for `assert_raises` with arguments of regular expression literals.
|
573
|
-
# Arguments should be exception classes.
|
574
|
-
# Optionally the last argument can be a custom message string to help explain failures.
|
575
|
-
# Either way, it's not the argument that `exception.message` is compared to.
|
576
|
-
# The raised exception is returned and can be used
|
577
|
-
# to match against a regular expression.
|
578
|
-
#
|
579
|
-
# @example
|
580
|
-
#
|
581
|
-
# # bad
|
582
|
-
# assert_raises FooError, /some message/ do
|
583
|
-
# obj.occur_error
|
584
|
-
# end
|
585
|
-
#
|
586
|
-
# # good
|
587
|
-
# exception = assert_raises FooError do
|
588
|
-
# obj.occur_error
|
589
|
-
# end
|
590
|
-
# assert_match(/some message/, exception.message)
|
591
|
-
#
|
592
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_raises_with_regexp_argument.rb#26
|
593
|
-
class RuboCop::Cop::Minitest::AssertRaisesWithRegexpArgument < ::RuboCop::Cop::Base
|
594
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_raises_with_regexp_argument.rb#30
|
595
|
-
def on_send(node); end
|
596
|
-
end
|
597
|
-
|
598
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_raises_with_regexp_argument.rb#27
|
599
|
-
RuboCop::Cop::Minitest::AssertRaisesWithRegexpArgument::MSG = T.let(T.unsafe(nil), String)
|
600
|
-
|
601
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_raises_with_regexp_argument.rb#28
|
602
|
-
RuboCop::Cop::Minitest::AssertRaisesWithRegexpArgument::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
603
|
-
|
604
|
-
# Enforces the use of `assert_respond_to(object, :do_something)`
|
605
|
-
# over `assert(object.respond_to?(:do_something))`.
|
606
|
-
#
|
607
|
-
# @example
|
608
|
-
# # bad
|
609
|
-
# assert(object.respond_to?(:do_something))
|
610
|
-
# assert(object.respond_to?(:do_something), 'message')
|
611
|
-
# assert(respond_to?(:do_something))
|
612
|
-
#
|
613
|
-
# # good
|
614
|
-
# assert_respond_to(object, :do_something)
|
615
|
-
# assert_respond_to(object, :do_something, 'message')
|
616
|
-
# assert_respond_to(self, :do_something)
|
617
|
-
#
|
618
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_respond_to.rb#20
|
619
|
-
class RuboCop::Cop::Minitest::AssertRespondTo < ::RuboCop::Cop::Base
|
620
|
-
include ::RuboCop::Cop::RangeHelp
|
621
|
-
include ::RuboCop::Cop::ArgumentRangeHelper
|
622
|
-
extend ::RuboCop::Cop::MinitestCopRule
|
623
|
-
extend ::RuboCop::Cop::AutoCorrector
|
624
|
-
|
625
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#57
|
626
|
-
def autocorrect(corrector, node, arguments); end
|
627
|
-
|
628
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#46
|
629
|
-
def on_send(node); end
|
630
|
-
|
631
|
-
private
|
632
|
-
|
633
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#95
|
634
|
-
def correct_receiver(receiver); end
|
635
|
-
|
636
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#81
|
637
|
-
def new_arguments(arguments); end
|
638
|
-
|
639
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#67
|
640
|
-
def offense_message(arguments); end
|
641
|
-
end
|
642
|
-
|
643
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#43
|
644
|
-
RuboCop::Cop::Minitest::AssertRespondTo::MSG = T.let(T.unsafe(nil), String)
|
645
|
-
|
646
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#44
|
647
|
-
RuboCop::Cop::Minitest::AssertRespondTo::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
648
|
-
|
649
|
-
# Enforces the use of `assert_same(expected, actual)`
|
650
|
-
# over `assert(expected.equal?(actual))`.
|
651
|
-
#
|
652
|
-
# NOTE: Use `assert_same` only when there is a need to compare by identity.
|
653
|
-
# Otherwise, use `assert_equal`.
|
654
|
-
#
|
655
|
-
# @example
|
656
|
-
# # bad
|
657
|
-
# assert(expected.equal?(actual))
|
658
|
-
# assert_equal(expected.object_id, actual.object_id)
|
659
|
-
#
|
660
|
-
# # good
|
661
|
-
# assert_same(expected, actual)
|
662
|
-
#
|
663
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_same.rb#20
|
664
|
-
class RuboCop::Cop::Minitest::AssertSame < ::RuboCop::Cop::Base
|
665
|
-
extend ::RuboCop::Cop::AutoCorrector
|
666
|
-
|
667
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_same.rb#32
|
668
|
-
def assert_equal_with_object_id?(param0 = T.unsafe(nil)); end
|
669
|
-
|
670
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_same.rb#26
|
671
|
-
def assert_with_equal?(param0 = T.unsafe(nil)); end
|
672
|
-
|
673
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_same.rb#40
|
674
|
-
def on_send(node); end
|
675
|
-
|
676
|
-
private
|
677
|
-
|
678
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_same.rb#58
|
679
|
-
def message(expected_node, actual_node, message_node); end
|
680
|
-
|
681
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_same.rb#63
|
682
|
-
def remove_method_call(send_node, corrector); end
|
683
|
-
end
|
684
|
-
|
685
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_same.rb#23
|
686
|
-
RuboCop::Cop::Minitest::AssertSame::MSG = T.let(T.unsafe(nil), String)
|
687
|
-
|
688
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_same.rb#24
|
689
|
-
RuboCop::Cop::Minitest::AssertSame::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
690
|
-
|
691
|
-
# Enforces the test to use `assert_silent { ... }`
|
692
|
-
# instead of using `assert_output('', '') { ... }`.
|
693
|
-
#
|
694
|
-
# @example
|
695
|
-
# # bad
|
696
|
-
# assert_output('', '') { puts object.do_something }
|
697
|
-
#
|
698
|
-
# # good
|
699
|
-
# assert_silent { puts object.do_something }
|
700
|
-
#
|
701
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_silent.rb#16
|
702
|
-
class RuboCop::Cop::Minitest::AssertSilent < ::RuboCop::Cop::Base
|
703
|
-
extend ::RuboCop::Cop::AutoCorrector
|
704
|
-
|
705
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_silent.rb#21
|
706
|
-
def assert_silent_candidate?(param0 = T.unsafe(nil)); end
|
707
|
-
|
708
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_silent.rb#29
|
709
|
-
def on_block(node); end
|
710
|
-
|
711
|
-
private
|
712
|
-
|
713
|
-
# @return [Boolean]
|
714
|
-
#
|
715
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_silent.rb#41
|
716
|
-
def empty_string?(node); end
|
717
|
-
end
|
718
|
-
|
719
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_silent.rb#19
|
720
|
-
RuboCop::Cop::Minitest::AssertSilent::MSG = T.let(T.unsafe(nil), String)
|
721
|
-
|
722
|
-
# Enforces the test to use `assert(actual)` instead of using `assert_equal(true, actual)`.
|
723
|
-
#
|
724
|
-
# @example
|
725
|
-
# # bad
|
726
|
-
# assert_equal(true, actual)
|
727
|
-
# assert_equal(true, actual, 'message')
|
728
|
-
#
|
729
|
-
# # good
|
730
|
-
# assert(actual)
|
731
|
-
# assert(actual, 'message')
|
732
|
-
#
|
733
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_truthy.rb#27
|
734
|
-
class RuboCop::Cop::Minitest::AssertTruthy < ::RuboCop::Cop::Base
|
735
|
-
include ::RuboCop::Cop::RangeHelp
|
736
|
-
include ::RuboCop::Cop::ArgumentRangeHelper
|
737
|
-
extend ::RuboCop::Cop::AutoCorrector
|
738
|
-
|
739
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_truthy.rb#34
|
740
|
-
def assert_equal_with_truthy(param0 = T.unsafe(nil)); end
|
741
|
-
|
742
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_truthy.rb#38
|
743
|
-
def on_send(node); end
|
744
|
-
end
|
745
|
-
|
746
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_truthy.rb#31
|
747
|
-
RuboCop::Cop::Minitest::AssertTruthy::MSG = T.let(T.unsafe(nil), String)
|
748
|
-
|
749
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_truthy.rb#32
|
750
|
-
RuboCop::Cop::Minitest::AssertTruthy::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
751
|
-
|
752
|
-
# Tries to detect when a user accidentally used
|
753
|
-
# `assert` when they meant to use `assert_equal`.
|
754
|
-
#
|
755
|
-
# NOTE: The second argument to the `assert` method named `message` and `msg` is allowed.
|
756
|
-
# Because their names are inferred as message arguments.
|
757
|
-
#
|
758
|
-
# @example
|
759
|
-
# # bad
|
760
|
-
# assert(3, my_list.length)
|
761
|
-
# assert(expected, actual)
|
762
|
-
#
|
763
|
-
# # good
|
764
|
-
# assert_equal(3, my_list.length)
|
765
|
-
# assert_equal(expected, actual)
|
766
|
-
# assert(foo, 'message')
|
767
|
-
# assert(foo, message)
|
768
|
-
# assert(foo, msg)
|
769
|
-
#
|
770
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_with_expected_argument.rb#28
|
771
|
-
class RuboCop::Cop::Minitest::AssertWithExpectedArgument < ::RuboCop::Cop::Base
|
772
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_with_expected_argument.rb#33
|
773
|
-
def assert_with_two_arguments?(param0 = T.unsafe(nil)); end
|
774
|
-
|
775
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_with_expected_argument.rb#37
|
776
|
-
def on_send(node); end
|
777
|
-
end
|
778
|
-
|
779
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_with_expected_argument.rb#31
|
780
|
-
RuboCop::Cop::Minitest::AssertWithExpectedArgument::MESSAGE_VARIABLES = T.let(T.unsafe(nil), Array)
|
781
|
-
|
782
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_with_expected_argument.rb#29
|
783
|
-
RuboCop::Cop::Minitest::AssertWithExpectedArgument::MSG = T.let(T.unsafe(nil), String)
|
784
|
-
|
785
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assert_with_expected_argument.rb#30
|
786
|
-
RuboCop::Cop::Minitest::AssertWithExpectedArgument::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
787
|
-
|
788
|
-
# Checks for usage of assertions in lifecycle hooks.
|
789
|
-
#
|
790
|
-
# @example
|
791
|
-
# # bad
|
792
|
-
# class FooTest < Minitest::Test
|
793
|
-
# def setup
|
794
|
-
# assert_equal(foo, bar)
|
795
|
-
# end
|
796
|
-
# end
|
797
|
-
#
|
798
|
-
# # good
|
799
|
-
# class FooTest < Minitest::Test
|
800
|
-
# def test_something
|
801
|
-
# assert_equal(foo, bar)
|
802
|
-
# end
|
803
|
-
# end
|
804
|
-
#
|
805
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assertion_in_lifecycle_hook.rb#23
|
806
|
-
class RuboCop::Cop::Minitest::AssertionInLifecycleHook < ::RuboCop::Cop::Base
|
807
|
-
include ::RuboCop::Cop::VisibilityHelp
|
808
|
-
include ::RuboCop::Cop::DefNode
|
809
|
-
include ::RuboCop::Cop::MinitestExplorationHelpers
|
810
|
-
|
811
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assertion_in_lifecycle_hook.rb#28
|
812
|
-
def on_class(class_node); end
|
813
|
-
end
|
814
|
-
|
815
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/assertion_in_lifecycle_hook.rb#26
|
816
|
-
RuboCop::Cop::Minitest::AssertionInLifecycleHook::MSG = T.let(T.unsafe(nil), String)
|
817
|
-
|
818
|
-
# If a Minitest class inherits from another class,
|
819
|
-
# it will also inherit its methods causing Minitest to run the parent's tests methods twice.
|
820
|
-
#
|
821
|
-
# This cop detects when there are two tests classes, one inherits from the other, and both have tests methods.
|
822
|
-
# This cop will add an offense to the Child class in such a case.
|
823
|
-
#
|
824
|
-
# @example
|
825
|
-
# # bad
|
826
|
-
# class ParentTest < Minitest::Test
|
827
|
-
# def test_parent # it will run this test twice.
|
828
|
-
# end
|
829
|
-
# end
|
830
|
-
#
|
831
|
-
# class ChildTest < ParentTest
|
832
|
-
# def test_child
|
833
|
-
# end
|
834
|
-
# end
|
835
|
-
#
|
836
|
-
# # good
|
837
|
-
# class ParentTest < Minitest::Test
|
838
|
-
# def test_parent
|
839
|
-
# end
|
840
|
-
# end
|
841
|
-
#
|
842
|
-
# class ChildTest < Minitest::Test
|
843
|
-
# def test_child
|
844
|
-
# end
|
845
|
-
# end
|
846
|
-
#
|
847
|
-
# # good
|
848
|
-
# class ParentTest < Minitest::Test
|
849
|
-
# end
|
850
|
-
#
|
851
|
-
# class ChildTest
|
852
|
-
# def test_child
|
853
|
-
# end
|
854
|
-
#
|
855
|
-
# def test_parent
|
856
|
-
# end
|
857
|
-
# end
|
858
|
-
#
|
859
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/duplicate_test_run.rb#48
|
860
|
-
class RuboCop::Cop::Minitest::DuplicateTestRun < ::RuboCop::Cop::Base
|
861
|
-
include ::RuboCop::Cop::VisibilityHelp
|
862
|
-
include ::RuboCop::Cop::DefNode
|
863
|
-
include ::RuboCop::Cop::MinitestExplorationHelpers
|
864
|
-
|
865
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/duplicate_test_run.rb#53
|
866
|
-
def on_class(class_node); end
|
867
|
-
|
868
|
-
private
|
869
|
-
|
870
|
-
# @return [Boolean]
|
871
|
-
#
|
872
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/duplicate_test_run.rb#64
|
873
|
-
def parent_class_has_test_methods?(class_node); end
|
874
|
-
|
875
|
-
# @return [Boolean]
|
876
|
-
#
|
877
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/duplicate_test_run.rb#78
|
878
|
-
def test_methods?(class_node); end
|
879
|
-
end
|
880
|
-
|
881
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/duplicate_test_run.rb#51
|
882
|
-
RuboCop::Cop::Minitest::DuplicateTestRun::MSG = T.let(T.unsafe(nil), String)
|
883
|
-
|
884
|
-
# Enforces empty line before assertion methods because it separates assertion phase.
|
885
|
-
#
|
886
|
-
# @example
|
887
|
-
#
|
888
|
-
# # bad
|
889
|
-
# do_something
|
890
|
-
# assert_equal(expected, actual)
|
891
|
-
#
|
892
|
-
# # good
|
893
|
-
# do_something
|
894
|
-
#
|
895
|
-
# assert_equal(expected, actual)
|
896
|
-
#
|
897
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/empty_line_before_assertion_methods.rb#19
|
898
|
-
class RuboCop::Cop::Minitest::EmptyLineBeforeAssertionMethods < ::RuboCop::Cop::Base
|
899
|
-
include ::RuboCop::Cop::VisibilityHelp
|
900
|
-
include ::RuboCop::Cop::DefNode
|
901
|
-
include ::RuboCop::Cop::MinitestExplorationHelpers
|
902
|
-
include ::RuboCop::Cop::RangeHelp
|
903
|
-
extend ::RuboCop::Cop::AutoCorrector
|
904
|
-
|
905
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/empty_line_before_assertion_methods.rb#27
|
906
|
-
def on_send(node); end
|
907
|
-
|
908
|
-
private
|
909
|
-
|
910
|
-
# @return [Boolean]
|
911
|
-
#
|
912
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/empty_line_before_assertion_methods.rb#52
|
913
|
-
def accept_previous_line?(previous_line_node, node); end
|
914
|
-
|
915
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/empty_line_before_assertion_methods.rb#43
|
916
|
-
def assertion_method(node); end
|
917
|
-
|
918
|
-
# @return [Boolean]
|
919
|
-
#
|
920
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/empty_line_before_assertion_methods.rb#73
|
921
|
-
def heredoc?(last_argument); end
|
922
|
-
|
923
|
-
# @return [Boolean]
|
924
|
-
#
|
925
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/empty_line_before_assertion_methods.rb#77
|
926
|
-
def no_empty_line?(previous_line_node, node); end
|
927
|
-
|
928
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/empty_line_before_assertion_methods.rb#87
|
929
|
-
def register_offense(node, previous_line_node); end
|
930
|
-
|
931
|
-
# @return [Boolean]
|
932
|
-
#
|
933
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/empty_line_before_assertion_methods.rb#63
|
934
|
-
def use_assertion_method_at_last_of_block?(node); end
|
935
|
-
|
936
|
-
# @return [Boolean]
|
937
|
-
#
|
938
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/empty_line_before_assertion_methods.rb#59
|
939
|
-
def use_heredoc_argument?(node); end
|
940
|
-
end
|
941
|
-
|
942
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/empty_line_before_assertion_methods.rb#24
|
943
|
-
RuboCop::Cop::Minitest::EmptyLineBeforeAssertionMethods::MSG = T.let(T.unsafe(nil), String)
|
944
|
-
|
945
|
-
# Checks for deprecated global expectations
|
946
|
-
# and autocorrects them to use expect format.
|
947
|
-
#
|
948
|
-
# @example EnforcedStyle: any (default)
|
949
|
-
# # bad
|
950
|
-
# musts.must_equal expected_musts
|
951
|
-
# wonts.wont_match expected_wonts
|
952
|
-
# musts.must_raise TypeError
|
953
|
-
#
|
954
|
-
# # good
|
955
|
-
# _(musts).must_equal expected_musts
|
956
|
-
# _(wonts).wont_match expected_wonts
|
957
|
-
# _ { musts }.must_raise TypeError
|
958
|
-
#
|
959
|
-
# expect(musts).must_equal expected_musts
|
960
|
-
# expect(wonts).wont_match expected_wonts
|
961
|
-
# expect { musts }.must_raise TypeError
|
962
|
-
#
|
963
|
-
# value(musts).must_equal expected_musts
|
964
|
-
# value(wonts).wont_match expected_wonts
|
965
|
-
# value { musts }.must_raise TypeError
|
966
|
-
# @example EnforcedStyle: _
|
967
|
-
# # bad
|
968
|
-
# musts.must_equal expected_musts
|
969
|
-
# wonts.wont_match expected_wonts
|
970
|
-
# musts.must_raise TypeError
|
971
|
-
#
|
972
|
-
# expect(musts).must_equal expected_musts
|
973
|
-
# expect(wonts).wont_match expected_wonts
|
974
|
-
# expect { musts }.must_raise TypeError
|
975
|
-
#
|
976
|
-
# value(musts).must_equal expected_musts
|
977
|
-
# value(wonts).wont_match expected_wonts
|
978
|
-
# value { musts }.must_raise TypeError
|
979
|
-
#
|
980
|
-
# # good
|
981
|
-
# _(musts).must_equal expected_musts
|
982
|
-
# _(wonts).wont_match expected_wonts
|
983
|
-
# _ { musts }.must_raise TypeError
|
984
|
-
# @example EnforcedStyle: expect
|
985
|
-
# # bad
|
986
|
-
# musts.must_equal expected_musts
|
987
|
-
# wonts.wont_match expected_wonts
|
988
|
-
# musts.must_raise TypeError
|
989
|
-
#
|
990
|
-
# _(musts).must_equal expected_musts
|
991
|
-
# _(wonts).wont_match expected_wonts
|
992
|
-
# _ { musts }.must_raise TypeError
|
993
|
-
#
|
994
|
-
# value(musts).must_equal expected_musts
|
995
|
-
# value(wonts).wont_match expected_wonts
|
996
|
-
# value { musts }.must_raise TypeError
|
997
|
-
#
|
998
|
-
# # good
|
999
|
-
# expect(musts).must_equal expected_musts
|
1000
|
-
# expect(wonts).wont_match expected_wonts
|
1001
|
-
# expect { musts }.must_raise TypeError
|
1002
|
-
# @example EnforcedStyle: value
|
1003
|
-
# # bad
|
1004
|
-
# musts.must_equal expected_musts
|
1005
|
-
# wonts.wont_match expected_wonts
|
1006
|
-
# musts.must_raise TypeError
|
1007
|
-
#
|
1008
|
-
# _(musts).must_equal expected_musts
|
1009
|
-
# _(wonts).wont_match expected_wonts
|
1010
|
-
# _ { musts }.must_raise TypeError
|
1011
|
-
#
|
1012
|
-
# expect(musts).must_equal expected_musts
|
1013
|
-
# expect(wonts).wont_match expected_wonts
|
1014
|
-
# expect { musts }.must_raise TypeError
|
1015
|
-
#
|
1016
|
-
# # good
|
1017
|
-
# value(musts).must_equal expected_musts
|
1018
|
-
# value(wonts).wont_match expected_wonts
|
1019
|
-
# value { musts }.must_raise TypeError
|
1020
|
-
#
|
1021
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/global_expectations.rb#84
|
1022
|
-
class RuboCop::Cop::Minitest::GlobalExpectations < ::RuboCop::Cop::Base
|
1023
|
-
include ::RuboCop::Cop::ConfigurableEnforcedStyle
|
1024
|
-
extend ::RuboCop::Cop::AutoCorrector
|
1025
|
-
|
1026
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/global_expectations.rb#120
|
1027
|
-
def block_receiver?(param0 = T.unsafe(nil)); end
|
1028
|
-
|
1029
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/global_expectations.rb#108
|
1030
|
-
def on_send(node); end
|
1031
|
-
|
1032
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/global_expectations.rb#124
|
1033
|
-
def value_receiver?(param0 = T.unsafe(nil)); end
|
1034
|
-
|
1035
|
-
private
|
1036
|
-
|
1037
|
-
# @return [Boolean]
|
1038
|
-
#
|
1039
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/global_expectations.rb#128
|
1040
|
-
def method_allowed?(method); end
|
1041
|
-
|
1042
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/global_expectations.rb#132
|
1043
|
-
def preferred_method; end
|
1044
|
-
|
1045
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/global_expectations.rb#136
|
1046
|
-
def preferred_receiver(node); end
|
1047
|
-
|
1048
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/global_expectations.rb#147
|
1049
|
-
def register_offense(node, method); end
|
1050
|
-
end
|
1051
|
-
|
1052
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/global_expectations.rb#99
|
1053
|
-
RuboCop::Cop::Minitest::GlobalExpectations::BLOCK_MATCHERS = T.let(T.unsafe(nil), Array)
|
1054
|
-
|
1055
|
-
# There are aliases for the `_` method - `expect` and `value`
|
1056
|
-
#
|
1057
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/global_expectations.rb#106
|
1058
|
-
RuboCop::Cop::Minitest::GlobalExpectations::DSL_METHODS = T.let(T.unsafe(nil), Array)
|
1059
|
-
|
1060
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/global_expectations.rb#88
|
1061
|
-
RuboCop::Cop::Minitest::GlobalExpectations::MSG = T.let(T.unsafe(nil), String)
|
1062
|
-
|
1063
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/global_expectations.rb#103
|
1064
|
-
RuboCop::Cop::Minitest::GlobalExpectations::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
1065
|
-
|
1066
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/global_expectations.rb#90
|
1067
|
-
RuboCop::Cop::Minitest::GlobalExpectations::VALUE_MATCHERS = T.let(T.unsafe(nil), Array)
|
1068
|
-
|
1069
|
-
# Common functionality for `Minitest/AssertInstanceOf` and `Minitest/RefuteInstanceOf` cops.
|
1070
|
-
#
|
1071
|
-
# @api private
|
1072
|
-
#
|
1073
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/instance_of_assertion_handleable.rb#8
|
1074
|
-
module RuboCop::Cop::Minitest::InstanceOfAssertionHandleable
|
1075
|
-
include ::RuboCop::Cop::RangeHelp
|
1076
|
-
include ::RuboCop::Cop::ArgumentRangeHelper
|
1077
|
-
|
1078
|
-
private
|
1079
|
-
|
1080
|
-
# @api private
|
1081
|
-
#
|
1082
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/instance_of_assertion_handleable.rb#30
|
1083
|
-
def build_required_arguments(node, method_name, first_capture, second_capture); end
|
1084
|
-
|
1085
|
-
# @api private
|
1086
|
-
#
|
1087
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/instance_of_assertion_handleable.rb#15
|
1088
|
-
def investigate(node, assertion_type); end
|
1089
|
-
|
1090
|
-
# @api private
|
1091
|
-
#
|
1092
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/instance_of_assertion_handleable.rb#38
|
1093
|
-
def replacement_range(node, method_name); end
|
1094
|
-
end
|
1095
|
-
|
1096
|
-
# @api private
|
1097
|
-
#
|
1098
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/instance_of_assertion_handleable.rb#11
|
1099
|
-
RuboCop::Cop::Minitest::InstanceOfAssertionHandleable::MSG = T.let(T.unsafe(nil), String)
|
1100
|
-
|
1101
|
-
# Checks that lifecycle hooks are declared in the order in which they will be executed.
|
1102
|
-
#
|
1103
|
-
# @example
|
1104
|
-
# # bad
|
1105
|
-
# class FooTest < Minitest::Test
|
1106
|
-
# def teardown; end
|
1107
|
-
# def setup; end
|
1108
|
-
# end
|
1109
|
-
#
|
1110
|
-
# # good
|
1111
|
-
# class FooTest < Minitest::Test
|
1112
|
-
# def setup; end
|
1113
|
-
# def teardown; end
|
1114
|
-
# end
|
1115
|
-
#
|
1116
|
-
# # bad (after test cases)
|
1117
|
-
# class FooTest < Minitest::Test
|
1118
|
-
# def test_something
|
1119
|
-
# assert foo
|
1120
|
-
# end
|
1121
|
-
# def setup; end
|
1122
|
-
# def teardown; end
|
1123
|
-
# end
|
1124
|
-
#
|
1125
|
-
# # good
|
1126
|
-
# class FooTest < Minitest::Test
|
1127
|
-
# def setup; end
|
1128
|
-
# def teardown; end
|
1129
|
-
# def test_something
|
1130
|
-
# assert foo
|
1131
|
-
# end
|
1132
|
-
# end
|
1133
|
-
#
|
1134
|
-
# # good (after non test case methods)
|
1135
|
-
# class FooTest < Minitest::Test
|
1136
|
-
# def do_something; end
|
1137
|
-
# def setup; end
|
1138
|
-
# def teardown; end
|
1139
|
-
# end
|
1140
|
-
#
|
1141
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/lifecycle_hooks_order.rb#46
|
1142
|
-
class RuboCop::Cop::Minitest::LifecycleHooksOrder < ::RuboCop::Cop::Base
|
1143
|
-
include ::RuboCop::Cop::VisibilityHelp
|
1144
|
-
include ::RuboCop::Cop::DefNode
|
1145
|
-
include ::RuboCop::Cop::MinitestExplorationHelpers
|
1146
|
-
include ::RuboCop::Cop::RangeHelp
|
1147
|
-
extend ::RuboCop::Cop::AutoCorrector
|
1148
|
-
|
1149
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/lifecycle_hooks_order.rb#60
|
1150
|
-
def on_class(class_node); end
|
1151
|
-
|
1152
|
-
private
|
1153
|
-
|
1154
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/lifecycle_hooks_order.rb#90
|
1155
|
-
def autocorrect(corrector, previous_node, node); end
|
1156
|
-
|
1157
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/lifecycle_hooks_order.rb#84
|
1158
|
-
def hooks_and_test_cases(class_node); end
|
1159
|
-
end
|
1160
|
-
|
1161
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/lifecycle_hooks_order.rb#55
|
1162
|
-
RuboCop::Cop::Minitest::LifecycleHooksOrder::HOOKS_ORDER_MAP = T.let(T.unsafe(nil), Hash)
|
1163
|
-
|
1164
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/lifecycle_hooks_order.rb#51
|
1165
|
-
RuboCop::Cop::Minitest::LifecycleHooksOrder::MSG = T.let(T.unsafe(nil), String)
|
1166
|
-
|
1167
|
-
# Regular method's position should be last.
|
1168
|
-
#
|
1169
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/lifecycle_hooks_order.rb#54
|
1170
|
-
RuboCop::Cop::Minitest::LifecycleHooksOrder::REGULAR_METHOD_POSITION = T.let(T.unsafe(nil), Integer)
|
1171
|
-
|
1172
|
-
# Enforces correct order of expected and
|
1173
|
-
# actual arguments for `assert_equal`.
|
1174
|
-
#
|
1175
|
-
# @example
|
1176
|
-
# # bad
|
1177
|
-
# assert_equal foo, 2
|
1178
|
-
# assert_equal foo, [1, 2]
|
1179
|
-
# assert_equal foo, [1, 2], 'message'
|
1180
|
-
#
|
1181
|
-
# # good
|
1182
|
-
# assert_equal 2, foo
|
1183
|
-
# assert_equal [1, 2], foo
|
1184
|
-
# assert_equal [1, 2], foo, 'message'
|
1185
|
-
#
|
1186
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/literal_as_actual_argument.rb#20
|
1187
|
-
class RuboCop::Cop::Minitest::LiteralAsActualArgument < ::RuboCop::Cop::Base
|
1188
|
-
include ::RuboCop::Cop::RangeHelp
|
1189
|
-
include ::RuboCop::Cop::ArgumentRangeHelper
|
1190
|
-
extend ::RuboCop::Cop::AutoCorrector
|
1191
|
-
|
1192
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/literal_as_actual_argument.rb#27
|
1193
|
-
def on_send(node); end
|
1194
|
-
|
1195
|
-
private
|
1196
|
-
|
1197
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/literal_as_actual_argument.rb#41
|
1198
|
-
def autocorrect(corrector, node, expected, actual); end
|
1199
|
-
|
1200
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/literal_as_actual_argument.rb#54
|
1201
|
-
def wrap_with_parentheses(corrector, node); end
|
1202
|
-
end
|
1203
|
-
|
1204
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/literal_as_actual_argument.rb#24
|
1205
|
-
RuboCop::Cop::Minitest::LiteralAsActualArgument::MSG = T.let(T.unsafe(nil), String)
|
1206
|
-
|
1207
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/literal_as_actual_argument.rb#25
|
1208
|
-
RuboCop::Cop::Minitest::LiteralAsActualArgument::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
1209
|
-
|
1210
|
-
# Checks if test cases contain too many assertion calls. If conditional code with assertions
|
1211
|
-
# is used, the branch with maximum assertions is counted.
|
1212
|
-
# The maximum allowed assertion calls is configurable.
|
1213
|
-
#
|
1214
|
-
# @example Max: 1
|
1215
|
-
# # bad
|
1216
|
-
# class FooTest < Minitest::Test
|
1217
|
-
# def test_asserts_twice
|
1218
|
-
# assert_equal(42, do_something)
|
1219
|
-
# assert_empty(array)
|
1220
|
-
# end
|
1221
|
-
# end
|
1222
|
-
#
|
1223
|
-
# # good
|
1224
|
-
# class FooTest < Minitest::Test
|
1225
|
-
# def test_asserts_once
|
1226
|
-
# assert_equal(42, do_something)
|
1227
|
-
# end
|
1228
|
-
#
|
1229
|
-
# def test_another_asserts_once
|
1230
|
-
# assert_empty(array)
|
1231
|
-
# end
|
1232
|
-
# end
|
1233
|
-
#
|
1234
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/multiple_assertions.rb#30
|
1235
|
-
class RuboCop::Cop::Minitest::MultipleAssertions < ::RuboCop::Cop::Base
|
1236
|
-
include ::RuboCop::Cop::ConfigurableMax
|
1237
|
-
include ::RuboCop::Cop::VisibilityHelp
|
1238
|
-
include ::RuboCop::Cop::DefNode
|
1239
|
-
include ::RuboCop::Cop::MinitestExplorationHelpers
|
1240
|
-
|
1241
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/multiple_assertions.rb#36
|
1242
|
-
def on_class(class_node); end
|
1243
|
-
|
1244
|
-
private
|
1245
|
-
|
1246
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/multiple_assertions.rb#53
|
1247
|
-
def assertions_count(node); end
|
1248
|
-
|
1249
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/multiple_assertions.rb#61
|
1250
|
-
def assertions_count_based_on_type(node); end
|
1251
|
-
|
1252
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/multiple_assertions.rb#76
|
1253
|
-
def assertions_count_in_assignment(node); end
|
1254
|
-
|
1255
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/multiple_assertions.rb#94
|
1256
|
-
def assertions_count_in_branches(branches); end
|
1257
|
-
|
1258
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/multiple_assertions.rb#98
|
1259
|
-
def max_assertions; end
|
1260
|
-
end
|
1261
|
-
|
1262
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/multiple_assertions.rb#34
|
1263
|
-
RuboCop::Cop::Minitest::MultipleAssertions::MSG = T.let(T.unsafe(nil), String)
|
1264
|
-
|
1265
|
-
# Common functionality for `AssertNil` and `RefuteNil` cops.
|
1266
|
-
#
|
1267
|
-
# @api private
|
1268
|
-
#
|
1269
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/nil_assertion_handleable.rb#8
|
1270
|
-
module RuboCop::Cop::Minitest::NilAssertionHandleable
|
1271
|
-
private
|
1272
|
-
|
1273
|
-
# @api private
|
1274
|
-
#
|
1275
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/nil_assertion_handleable.rb#35
|
1276
|
-
def autocorrect(corrector, node, actual); end
|
1277
|
-
|
1278
|
-
# @api private
|
1279
|
-
#
|
1280
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/nil_assertion_handleable.rb#21
|
1281
|
-
def build_message(node, actual, message); end
|
1282
|
-
|
1283
|
-
# @api private
|
1284
|
-
# @return [Boolean]
|
1285
|
-
#
|
1286
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/nil_assertion_handleable.rb#45
|
1287
|
-
def comparison_or_predicate_assertion_method?(node); end
|
1288
|
-
|
1289
|
-
# @api private
|
1290
|
-
#
|
1291
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/nil_assertion_handleable.rb#13
|
1292
|
-
def register_offense(node, actual, message); end
|
1293
|
-
end
|
1294
|
-
|
1295
|
-
# @api private
|
1296
|
-
#
|
1297
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/nil_assertion_handleable.rb#9
|
1298
|
-
RuboCop::Cop::Minitest::NilAssertionHandleable::MSG = T.let(T.unsafe(nil), String)
|
1299
|
-
|
1300
|
-
# Checks if test cases contain any assertion calls.
|
1301
|
-
#
|
1302
|
-
# @example
|
1303
|
-
# # bad
|
1304
|
-
# class FooTest < Minitest::Test
|
1305
|
-
# def test_the_truth
|
1306
|
-
# end
|
1307
|
-
# end
|
1308
|
-
#
|
1309
|
-
# # good
|
1310
|
-
# class FooTest < Minitest::Test
|
1311
|
-
# def test_the_truth
|
1312
|
-
# assert true
|
1313
|
-
# end
|
1314
|
-
# end
|
1315
|
-
#
|
1316
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/no_assertions.rb#22
|
1317
|
-
class RuboCop::Cop::Minitest::NoAssertions < ::RuboCop::Cop::Base
|
1318
|
-
include ::RuboCop::Cop::VisibilityHelp
|
1319
|
-
include ::RuboCop::Cop::DefNode
|
1320
|
-
include ::RuboCop::Cop::MinitestExplorationHelpers
|
1321
|
-
|
1322
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/no_assertions.rb#27
|
1323
|
-
def on_class(class_node); end
|
1324
|
-
end
|
1325
|
-
|
1326
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/no_assertions.rb#25
|
1327
|
-
RuboCop::Cop::Minitest::NoAssertions::MSG = T.let(T.unsafe(nil), String)
|
1328
|
-
|
1329
|
-
# Checks if test class contains any test cases.
|
1330
|
-
#
|
1331
|
-
# @example
|
1332
|
-
# # bad
|
1333
|
-
# class FooTest < Minitest::Test
|
1334
|
-
# def do_something
|
1335
|
-
# end
|
1336
|
-
# end
|
1337
|
-
#
|
1338
|
-
# # good
|
1339
|
-
# class FooTest < Minitest::Test
|
1340
|
-
# def test_something
|
1341
|
-
# assert true
|
1342
|
-
# end
|
1343
|
-
# end
|
1344
|
-
#
|
1345
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/no_test_cases.rb#22
|
1346
|
-
class RuboCop::Cop::Minitest::NoTestCases < ::RuboCop::Cop::Base
|
1347
|
-
include ::RuboCop::Cop::VisibilityHelp
|
1348
|
-
include ::RuboCop::Cop::DefNode
|
1349
|
-
include ::RuboCop::Cop::MinitestExplorationHelpers
|
1350
|
-
|
1351
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/no_test_cases.rb#27
|
1352
|
-
def on_class(node); end
|
1353
|
-
end
|
1354
|
-
|
1355
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/no_test_cases.rb#25
|
1356
|
-
RuboCop::Cop::Minitest::NoTestCases::MSG = T.let(T.unsafe(nil), String)
|
1357
|
-
|
1358
|
-
# Checks for the use of test methods outside of a test class.
|
1359
|
-
#
|
1360
|
-
# Test methods should be defined within a test class to ensure their execution.
|
1361
|
-
#
|
1362
|
-
# NOTE: This cop assumes that classes whose superclass name includes the word
|
1363
|
-
# "`Test`" are test classes, in order to prevent false positives.
|
1364
|
-
#
|
1365
|
-
# @example
|
1366
|
-
#
|
1367
|
-
# # bad
|
1368
|
-
# class FooTest < Minitest::Test
|
1369
|
-
# end
|
1370
|
-
# def test_method_should_be_inside_test_class
|
1371
|
-
# end
|
1372
|
-
#
|
1373
|
-
# # good
|
1374
|
-
# class FooTest < Minitest::Test
|
1375
|
-
# def test_method_should_be_inside_test_class
|
1376
|
-
# end
|
1377
|
-
# end
|
1378
|
-
#
|
1379
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/non_executable_test_method.rb#27
|
1380
|
-
class RuboCop::Cop::Minitest::NonExecutableTestMethod < ::RuboCop::Cop::Base
|
1381
|
-
include ::RuboCop::Cop::VisibilityHelp
|
1382
|
-
include ::RuboCop::Cop::DefNode
|
1383
|
-
include ::RuboCop::Cop::MinitestExplorationHelpers
|
1384
|
-
|
1385
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/non_executable_test_method.rb#32
|
1386
|
-
def on_def(node); end
|
1387
|
-
|
1388
|
-
private
|
1389
|
-
|
1390
|
-
# @return [Boolean]
|
1391
|
-
#
|
1392
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/non_executable_test_method.rb#47
|
1393
|
-
def possible_test_class?(node); end
|
1394
|
-
|
1395
|
-
# @return [Boolean]
|
1396
|
-
#
|
1397
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/non_executable_test_method.rb#41
|
1398
|
-
def use_test_class?; end
|
1399
|
-
end
|
1400
|
-
|
1401
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/non_executable_test_method.rb#30
|
1402
|
-
RuboCop::Cop::Minitest::NonExecutableTestMethod::MSG = T.let(T.unsafe(nil), String)
|
1403
|
-
|
1404
|
-
# Detects non `public` (marked as `private` or `protected`) test methods.
|
1405
|
-
# Minitest runs only test methods which are `public`.
|
1406
|
-
#
|
1407
|
-
# @example
|
1408
|
-
# # bad
|
1409
|
-
# class FooTest
|
1410
|
-
# private # or protected
|
1411
|
-
# def test_does_something
|
1412
|
-
# assert_equal 42, do_something
|
1413
|
-
# end
|
1414
|
-
# end
|
1415
|
-
#
|
1416
|
-
# # good
|
1417
|
-
# class FooTest
|
1418
|
-
# def test_does_something
|
1419
|
-
# assert_equal 42, do_something
|
1420
|
-
# end
|
1421
|
-
# end
|
1422
|
-
#
|
1423
|
-
# # good (not a test case name)
|
1424
|
-
# class FooTest
|
1425
|
-
# private # or protected
|
1426
|
-
# def does_something
|
1427
|
-
# assert_equal 42, do_something
|
1428
|
-
# end
|
1429
|
-
# end
|
1430
|
-
#
|
1431
|
-
# # good (no assertions)
|
1432
|
-
# class FooTest
|
1433
|
-
# private # or protected
|
1434
|
-
# def test_does_something
|
1435
|
-
# do_something
|
1436
|
-
# end
|
1437
|
-
# end
|
1438
|
-
#
|
1439
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/non_public_test_method.rb#41
|
1440
|
-
class RuboCop::Cop::Minitest::NonPublicTestMethod < ::RuboCop::Cop::Base
|
1441
|
-
include ::RuboCop::Cop::VisibilityHelp
|
1442
|
-
include ::RuboCop::Cop::DefNode
|
1443
|
-
include ::RuboCop::Cop::MinitestExplorationHelpers
|
1444
|
-
|
1445
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/non_public_test_method.rb#47
|
1446
|
-
def on_class(node); end
|
1447
|
-
end
|
1448
|
-
|
1449
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/non_public_test_method.rb#45
|
1450
|
-
RuboCop::Cop::Minitest::NonPublicTestMethod::MSG = T.let(T.unsafe(nil), String)
|
1451
|
-
|
1452
|
-
# Common functionality for `Minitest/AssertPredicate` and `Minitest/RefutePredicate` cops.
|
1453
|
-
#
|
1454
|
-
# @api private
|
1455
|
-
#
|
1456
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/predicate_assertion_handleable.rb#8
|
1457
|
-
module RuboCop::Cop::Minitest::PredicateAssertionHandleable
|
1458
|
-
# @api private
|
1459
|
-
#
|
1460
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/predicate_assertion_handleable.rb#22
|
1461
|
-
def autocorrect(corrector, node, arguments); end
|
1462
|
-
|
1463
|
-
# @api private
|
1464
|
-
#
|
1465
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/predicate_assertion_handleable.rb#11
|
1466
|
-
def on_send(node); end
|
1467
|
-
|
1468
|
-
private
|
1469
|
-
|
1470
|
-
# @api private
|
1471
|
-
#
|
1472
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/predicate_assertion_handleable.rb#51
|
1473
|
-
def correct_receiver(receiver); end
|
1474
|
-
|
1475
|
-
# @api private
|
1476
|
-
#
|
1477
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/predicate_assertion_handleable.rb#44
|
1478
|
-
def new_arguments(arguments); end
|
1479
|
-
|
1480
|
-
# @api private
|
1481
|
-
#
|
1482
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/predicate_assertion_handleable.rb#36
|
1483
|
-
def offense_message(arguments); end
|
1484
|
-
|
1485
|
-
# @api private
|
1486
|
-
# @return [Boolean]
|
1487
|
-
#
|
1488
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/predicate_assertion_handleable.rb#32
|
1489
|
-
def predicate_method?(first_argument); end
|
1490
|
-
end
|
1491
|
-
|
1492
|
-
# @api private
|
1493
|
-
#
|
1494
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/predicate_assertion_handleable.rb#9
|
1495
|
-
RuboCop::Cop::Minitest::PredicateAssertionHandleable::MSG = T.let(T.unsafe(nil), String)
|
1496
|
-
|
1497
|
-
# Detects redundant message argument in assertion methods.
|
1498
|
-
# The message argument `nil` is redundant because it is the default value.
|
1499
|
-
#
|
1500
|
-
# @example
|
1501
|
-
#
|
1502
|
-
# # bad
|
1503
|
-
# assert_equal(expected, actual, nil)
|
1504
|
-
#
|
1505
|
-
# # good
|
1506
|
-
# assert_equal(expected, actual)
|
1507
|
-
# assert_equal(expected, actual, 'message')
|
1508
|
-
#
|
1509
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/redundant_message_argument.rb#18
|
1510
|
-
class RuboCop::Cop::Minitest::RedundantMessageArgument < ::RuboCop::Cop::Base
|
1511
|
-
extend ::RuboCop::Cop::AutoCorrector
|
1512
|
-
|
1513
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/redundant_message_argument.rb#71
|
1514
|
-
def on_send(node); end
|
1515
|
-
|
1516
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/redundant_message_argument.rb#34
|
1517
|
-
def redundant_message_argument(param0 = T.unsafe(nil)); end
|
1518
|
-
end
|
1519
|
-
|
1520
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/redundant_message_argument.rb#21
|
1521
|
-
RuboCop::Cop::Minitest::RedundantMessageArgument::MSG = T.let(T.unsafe(nil), String)
|
1522
|
-
|
1523
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/redundant_message_argument.rb#23
|
1524
|
-
RuboCop::Cop::Minitest::RedundantMessageArgument::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
1525
|
-
|
1526
|
-
# Enforces to use `refute_empty` instead of using `refute(object.empty?)`.
|
1527
|
-
#
|
1528
|
-
# @example
|
1529
|
-
# # bad
|
1530
|
-
# refute(object.empty?)
|
1531
|
-
# refute(object.empty?, 'message')
|
1532
|
-
#
|
1533
|
-
# # good
|
1534
|
-
# refute_empty(object)
|
1535
|
-
# refute_empty(object, 'message')
|
1536
|
-
#
|
1537
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_empty.rb#17
|
1538
|
-
class RuboCop::Cop::Minitest::RefuteEmpty < ::RuboCop::Cop::Base
|
1539
|
-
include ::RuboCop::Cop::RangeHelp
|
1540
|
-
include ::RuboCop::Cop::ArgumentRangeHelper
|
1541
|
-
extend ::RuboCop::Cop::MinitestCopRule
|
1542
|
-
extend ::RuboCop::Cop::AutoCorrector
|
1543
|
-
|
1544
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#57
|
1545
|
-
def autocorrect(corrector, node, arguments); end
|
1546
|
-
|
1547
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_empty.rb#23
|
1548
|
-
def on_send(node); end
|
1549
|
-
|
1550
|
-
private
|
1551
|
-
|
1552
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#95
|
1553
|
-
def correct_receiver(receiver); end
|
1554
|
-
|
1555
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#81
|
1556
|
-
def new_arguments(arguments); end
|
1557
|
-
|
1558
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#67
|
1559
|
-
def offense_message(arguments); end
|
1560
|
-
end
|
1561
|
-
|
1562
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#43
|
1563
|
-
RuboCop::Cop::Minitest::RefuteEmpty::MSG = T.let(T.unsafe(nil), String)
|
1564
|
-
|
1565
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#44
|
1566
|
-
RuboCop::Cop::Minitest::RefuteEmpty::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
1567
|
-
|
1568
|
-
# Enforces the use of `refute_equal(expected, object)`
|
1569
|
-
# over `assert(expected != actual)` or `assert(! expected == actual)`.
|
1570
|
-
#
|
1571
|
-
# @example
|
1572
|
-
# # bad
|
1573
|
-
# assert("rubocop-minitest" != actual)
|
1574
|
-
# refute("rubocop-minitest" == actual)
|
1575
|
-
# assert_operator("rubocop-minitest", :!=, actual)
|
1576
|
-
# refute_operator("rubocop-minitest", :==, actual)
|
1577
|
-
#
|
1578
|
-
# # good
|
1579
|
-
# refute_equal("rubocop-minitest", actual)
|
1580
|
-
#
|
1581
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_equal.rb#19
|
1582
|
-
class RuboCop::Cop::Minitest::RefuteEqual < ::RuboCop::Cop::Base
|
1583
|
-
include ::RuboCop::Cop::RangeHelp
|
1584
|
-
include ::RuboCop::Cop::ArgumentRangeHelper
|
1585
|
-
extend ::RuboCop::Cop::AutoCorrector
|
1586
|
-
|
1587
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_equal.rb#36
|
1588
|
-
def on_send(node); end
|
1589
|
-
|
1590
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_equal.rb#26
|
1591
|
-
def refute_equal(param0 = T.unsafe(nil)); end
|
1592
|
-
end
|
1593
|
-
|
1594
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_equal.rb#23
|
1595
|
-
RuboCop::Cop::Minitest::RefuteEqual::MSG = T.let(T.unsafe(nil), String)
|
1596
|
-
|
1597
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_equal.rb#24
|
1598
|
-
RuboCop::Cop::Minitest::RefuteEqual::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
1599
|
-
|
1600
|
-
# Enforces the use of `refute(object)` over `assert_equal(false, object)`.
|
1601
|
-
#
|
1602
|
-
# @example
|
1603
|
-
# # bad
|
1604
|
-
# assert_equal(false, actual)
|
1605
|
-
# assert_equal(false, actual, 'message')
|
1606
|
-
#
|
1607
|
-
# assert(!test)
|
1608
|
-
# assert(!test, 'message')
|
1609
|
-
#
|
1610
|
-
# # good
|
1611
|
-
# refute(actual)
|
1612
|
-
# refute(actual, 'message')
|
1613
|
-
#
|
1614
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_false.rb#30
|
1615
|
-
class RuboCop::Cop::Minitest::RefuteFalse < ::RuboCop::Cop::Base
|
1616
|
-
include ::RuboCop::Cop::RangeHelp
|
1617
|
-
include ::RuboCop::Cop::ArgumentRangeHelper
|
1618
|
-
extend ::RuboCop::Cop::AutoCorrector
|
1619
|
-
|
1620
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_false.rb#38
|
1621
|
-
def assert_equal_with_false(param0 = T.unsafe(nil)); end
|
1622
|
-
|
1623
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_false.rb#42
|
1624
|
-
def assert_with_bang_argument(param0 = T.unsafe(nil)); end
|
1625
|
-
|
1626
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_false.rb#46
|
1627
|
-
def on_send(node); end
|
1628
|
-
|
1629
|
-
private
|
1630
|
-
|
1631
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_false.rb#63
|
1632
|
-
def autocorrect(corrector, node, actual); end
|
1633
|
-
end
|
1634
|
-
|
1635
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_false.rb#35
|
1636
|
-
RuboCop::Cop::Minitest::RefuteFalse::MSG_FOR_ASSERT = T.let(T.unsafe(nil), String)
|
1637
|
-
|
1638
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_false.rb#34
|
1639
|
-
RuboCop::Cop::Minitest::RefuteFalse::MSG_FOR_ASSERT_EQUAL = T.let(T.unsafe(nil), String)
|
1640
|
-
|
1641
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_false.rb#36
|
1642
|
-
RuboCop::Cop::Minitest::RefuteFalse::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
1643
|
-
|
1644
|
-
# Enforces the test to use `refute_in_delta`
|
1645
|
-
# instead of using `refute_equal` to compare floats.
|
1646
|
-
#
|
1647
|
-
# @example
|
1648
|
-
# # bad
|
1649
|
-
# refute_equal(0.2, actual)
|
1650
|
-
# refute_equal(0.2, actual, 'message')
|
1651
|
-
#
|
1652
|
-
# # good
|
1653
|
-
# refute_in_delta(0.2, actual)
|
1654
|
-
# refute_in_delta(0.2, actual, 0.001, 'message')
|
1655
|
-
#
|
1656
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_in_delta.rb#18
|
1657
|
-
class RuboCop::Cop::Minitest::RefuteInDelta < ::RuboCop::Cop::Base
|
1658
|
-
include ::RuboCop::Cop::InDeltaMixin
|
1659
|
-
extend ::RuboCop::Cop::AutoCorrector
|
1660
|
-
|
1661
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_in_delta.rb#24
|
1662
|
-
def equal_floats_call(param0 = T.unsafe(nil)); end
|
1663
|
-
end
|
1664
|
-
|
1665
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_in_delta.rb#22
|
1666
|
-
RuboCop::Cop::Minitest::RefuteInDelta::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
1667
|
-
|
1668
|
-
# Enforces the test to use `refute_includes`
|
1669
|
-
# instead of using `refute(collection.include?(object))`.
|
1670
|
-
#
|
1671
|
-
# @example
|
1672
|
-
# # bad
|
1673
|
-
# refute(collection.include?(object))
|
1674
|
-
# refute(collection.include?(object), 'message')
|
1675
|
-
#
|
1676
|
-
# # good
|
1677
|
-
# refute_includes(collection, object)
|
1678
|
-
# refute_includes(collection, object, 'message')
|
1679
|
-
#
|
1680
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_includes.rb#18
|
1681
|
-
class RuboCop::Cop::Minitest::RefuteIncludes < ::RuboCop::Cop::Base
|
1682
|
-
include ::RuboCop::Cop::RangeHelp
|
1683
|
-
include ::RuboCop::Cop::ArgumentRangeHelper
|
1684
|
-
extend ::RuboCop::Cop::MinitestCopRule
|
1685
|
-
extend ::RuboCop::Cop::AutoCorrector
|
1686
|
-
|
1687
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#57
|
1688
|
-
def autocorrect(corrector, node, arguments); end
|
1689
|
-
|
1690
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#46
|
1691
|
-
def on_send(node); end
|
1692
|
-
|
1693
|
-
private
|
1694
|
-
|
1695
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#95
|
1696
|
-
def correct_receiver(receiver); end
|
1697
|
-
|
1698
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#81
|
1699
|
-
def new_arguments(arguments); end
|
1700
|
-
|
1701
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#67
|
1702
|
-
def offense_message(arguments); end
|
1703
|
-
end
|
1704
|
-
|
1705
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#43
|
1706
|
-
RuboCop::Cop::Minitest::RefuteIncludes::MSG = T.let(T.unsafe(nil), String)
|
1707
|
-
|
1708
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#44
|
1709
|
-
RuboCop::Cop::Minitest::RefuteIncludes::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
1710
|
-
|
1711
|
-
# Enforces the use of `refute_instance_of(Class, object)`
|
1712
|
-
# over `refute(object.instance_of?(Class))`.
|
1713
|
-
#
|
1714
|
-
# @example
|
1715
|
-
# # bad
|
1716
|
-
# refute(object.instance_of?(Class))
|
1717
|
-
# refute(object.instance_of?(Class), 'message')
|
1718
|
-
#
|
1719
|
-
# # bad
|
1720
|
-
# refute_equal(Class, object.class)
|
1721
|
-
# refute_equal(Class, object.class, 'message')
|
1722
|
-
#
|
1723
|
-
# # good
|
1724
|
-
# refute_instance_of(Class, object)
|
1725
|
-
# refute_instance_of(Class, object, 'message')
|
1726
|
-
#
|
1727
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_instance_of.rb#22
|
1728
|
-
class RuboCop::Cop::Minitest::RefuteInstanceOf < ::RuboCop::Cop::Base
|
1729
|
-
include ::RuboCop::Cop::RangeHelp
|
1730
|
-
include ::RuboCop::Cop::ArgumentRangeHelper
|
1731
|
-
include ::RuboCop::Cop::Minitest::InstanceOfAssertionHandleable
|
1732
|
-
extend ::RuboCop::Cop::AutoCorrector
|
1733
|
-
|
1734
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_instance_of.rb#28
|
1735
|
-
def instance_of_assertion?(param0 = T.unsafe(nil)); end
|
1736
|
-
|
1737
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_instance_of.rb#35
|
1738
|
-
def on_send(node); end
|
1739
|
-
end
|
1740
|
-
|
1741
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_instance_of.rb#26
|
1742
|
-
RuboCop::Cop::Minitest::RefuteInstanceOf::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
1743
|
-
|
1744
|
-
# Enforces the use of `refute_kind_of(Class, object)`
|
1745
|
-
# over `refute(object.kind_of?(Class))`.
|
1746
|
-
#
|
1747
|
-
# @example
|
1748
|
-
# # bad
|
1749
|
-
# refute(object.kind_of?(Class))
|
1750
|
-
# refute(object.kind_of?(Class), 'message')
|
1751
|
-
#
|
1752
|
-
# # bad
|
1753
|
-
# # `is_a?` is an alias for `kind_of?`
|
1754
|
-
# refute(object.is_of?(Class))
|
1755
|
-
# refute(object.is_of?(Class), 'message')
|
1756
|
-
#
|
1757
|
-
# # good
|
1758
|
-
# refute_kind_of(Class, object)
|
1759
|
-
# refute_kind_of(Class, object, 'message')
|
1760
|
-
#
|
1761
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_kind_of.rb#23
|
1762
|
-
class RuboCop::Cop::Minitest::RefuteKindOf < ::RuboCop::Cop::Base
|
1763
|
-
include ::RuboCop::Cop::RangeHelp
|
1764
|
-
include ::RuboCop::Cop::ArgumentRangeHelper
|
1765
|
-
extend ::RuboCop::Cop::MinitestCopRule
|
1766
|
-
extend ::RuboCop::Cop::AutoCorrector
|
1767
|
-
|
1768
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#57
|
1769
|
-
def autocorrect(corrector, node, arguments); end
|
1770
|
-
|
1771
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#46
|
1772
|
-
def on_send(node); end
|
1773
|
-
|
1774
|
-
private
|
1775
|
-
|
1776
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#95
|
1777
|
-
def correct_receiver(receiver); end
|
1778
|
-
|
1779
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#81
|
1780
|
-
def new_arguments(arguments); end
|
1781
|
-
|
1782
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#67
|
1783
|
-
def offense_message(arguments); end
|
1784
|
-
end
|
1785
|
-
|
1786
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#43
|
1787
|
-
RuboCop::Cop::Minitest::RefuteKindOf::MSG = T.let(T.unsafe(nil), String)
|
1788
|
-
|
1789
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#44
|
1790
|
-
RuboCop::Cop::Minitest::RefuteKindOf::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
1791
|
-
|
1792
|
-
# Enforces the test to use `refute_match`
|
1793
|
-
# instead of using `refute(matcher.match(string))`.
|
1794
|
-
#
|
1795
|
-
# @example
|
1796
|
-
# # bad
|
1797
|
-
# refute(matcher.match(string))
|
1798
|
-
# refute(matcher.match?(string))
|
1799
|
-
# refute(matcher =~ string)
|
1800
|
-
# refute_operator(matcher, :=~, string)
|
1801
|
-
# assert_operator(matcher, :!~, string)
|
1802
|
-
# refute(matcher.match(string), 'message')
|
1803
|
-
#
|
1804
|
-
# # good
|
1805
|
-
# refute_match(matcher, string)
|
1806
|
-
# refute_match(matcher, string, 'message')
|
1807
|
-
#
|
1808
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_match.rb#22
|
1809
|
-
class RuboCop::Cop::Minitest::RefuteMatch < ::RuboCop::Cop::Base
|
1810
|
-
include ::RuboCop::Cop::RangeHelp
|
1811
|
-
include ::RuboCop::Cop::ArgumentRangeHelper
|
1812
|
-
extend ::RuboCop::Cop::AutoCorrector
|
1813
|
-
|
1814
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_match.rb#38
|
1815
|
-
def on_send(node); end
|
1816
|
-
|
1817
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_match.rb#29
|
1818
|
-
def refute_match(param0 = T.unsafe(nil)); end
|
1819
|
-
|
1820
|
-
private
|
1821
|
-
|
1822
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_match.rb#61
|
1823
|
-
def order_expected_and_actual(expected, actual); end
|
1824
|
-
end
|
1825
|
-
|
1826
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_match.rb#26
|
1827
|
-
RuboCop::Cop::Minitest::RefuteMatch::MSG = T.let(T.unsafe(nil), String)
|
1828
|
-
|
1829
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_match.rb#27
|
1830
|
-
RuboCop::Cop::Minitest::RefuteMatch::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
1831
|
-
|
1832
|
-
# Enforces the test to use `refute_nil` instead of using
|
1833
|
-
# `refute_equal(nil, something)`, `refute(something.nil?)`, or `refute_predicate(something, :nil?)`.
|
1834
|
-
#
|
1835
|
-
# @example
|
1836
|
-
# # bad
|
1837
|
-
# refute_equal(nil, actual)
|
1838
|
-
# refute_equal(nil, actual, 'message')
|
1839
|
-
# refute(actual.nil?)
|
1840
|
-
# refute(actual.nil?, 'message')
|
1841
|
-
# refute_predicate(object, :nil?)
|
1842
|
-
# refute_predicate(object, :nil?, 'message')
|
1843
|
-
#
|
1844
|
-
# # good
|
1845
|
-
# refute_nil(actual)
|
1846
|
-
# refute_nil(actual, 'message')
|
1847
|
-
#
|
1848
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_nil.rb#22
|
1849
|
-
class RuboCop::Cop::Minitest::RefuteNil < ::RuboCop::Cop::Base
|
1850
|
-
include ::RuboCop::Cop::RangeHelp
|
1851
|
-
include ::RuboCop::Cop::ArgumentRangeHelper
|
1852
|
-
include ::RuboCop::Cop::Minitest::NilAssertionHandleable
|
1853
|
-
extend ::RuboCop::Cop::AutoCorrector
|
1854
|
-
|
1855
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_nil.rb#30
|
1856
|
-
def nil_refutation(param0 = T.unsafe(nil)); end
|
1857
|
-
|
1858
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_nil.rb#38
|
1859
|
-
def on_send(node); end
|
1860
|
-
|
1861
|
-
private
|
1862
|
-
|
1863
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_nil.rb#46
|
1864
|
-
def assertion_type; end
|
1865
|
-
end
|
1866
|
-
|
1867
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_nil.rb#27
|
1868
|
-
RuboCop::Cop::Minitest::RefuteNil::ASSERTION_TYPE = T.let(T.unsafe(nil), String)
|
1869
|
-
|
1870
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_nil.rb#28
|
1871
|
-
RuboCop::Cop::Minitest::RefuteNil::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
1872
|
-
|
1873
|
-
# Enforces the use of `refute_operator(expected, :<, actual)` over `refute(expected < actual)`.
|
1874
|
-
#
|
1875
|
-
# @example
|
1876
|
-
#
|
1877
|
-
# # bad
|
1878
|
-
# refute(expected < actual)
|
1879
|
-
#
|
1880
|
-
# # good
|
1881
|
-
# refute_operator(expected, :<, actual)
|
1882
|
-
#
|
1883
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_operator.rb#16
|
1884
|
-
class RuboCop::Cop::Minitest::RefuteOperator < ::RuboCop::Cop::Base
|
1885
|
-
extend ::RuboCop::Cop::AutoCorrector
|
1886
|
-
|
1887
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_operator.rb#23
|
1888
|
-
def on_send(node); end
|
1889
|
-
|
1890
|
-
private
|
1891
|
-
|
1892
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_operator.rb#41
|
1893
|
-
def build_new_arguments(node); end
|
1894
|
-
|
1895
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_operator.rb#52
|
1896
|
-
def range_of_arguments(node); end
|
1897
|
-
end
|
1898
|
-
|
1899
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_operator.rb#21
|
1900
|
-
RuboCop::Cop::Minitest::RefuteOperator::ALLOWED_OPERATORS = T.let(T.unsafe(nil), Array)
|
1901
|
-
|
1902
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_operator.rb#19
|
1903
|
-
RuboCop::Cop::Minitest::RefuteOperator::MSG = T.let(T.unsafe(nil), String)
|
1904
|
-
|
1905
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_operator.rb#20
|
1906
|
-
RuboCop::Cop::Minitest::RefuteOperator::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
1907
|
-
|
1908
|
-
# Enforces the test to use `refute_path_exists` instead of using `refute(File.exist?(path))`.
|
1909
|
-
#
|
1910
|
-
# @example
|
1911
|
-
# # bad
|
1912
|
-
# refute(File.exist?(path))
|
1913
|
-
# refute(File.exist?(path), 'message')
|
1914
|
-
#
|
1915
|
-
# # good
|
1916
|
-
# refute_path_exists(path)
|
1917
|
-
# refute_path_exists(path, 'message')
|
1918
|
-
#
|
1919
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_path_exists.rb#17
|
1920
|
-
class RuboCop::Cop::Minitest::RefutePathExists < ::RuboCop::Cop::Base
|
1921
|
-
extend ::RuboCop::Cop::AutoCorrector
|
1922
|
-
|
1923
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_path_exists.rb#30
|
1924
|
-
def on_send(node); end
|
1925
|
-
|
1926
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_path_exists.rb#23
|
1927
|
-
def refute_file_exists(param0 = T.unsafe(nil)); end
|
1928
|
-
|
1929
|
-
private
|
1930
|
-
|
1931
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_path_exists.rb#45
|
1932
|
-
def build_good_method(node, path, message); end
|
1933
|
-
end
|
1934
|
-
|
1935
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_path_exists.rb#20
|
1936
|
-
RuboCop::Cop::Minitest::RefutePathExists::MSG = T.let(T.unsafe(nil), String)
|
1937
|
-
|
1938
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_path_exists.rb#21
|
1939
|
-
RuboCop::Cop::Minitest::RefutePathExists::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
1940
|
-
|
1941
|
-
# Enforces the test to use `refute_predicate`
|
1942
|
-
# instead of using `refute(obj.a_predicate_method?)`.
|
1943
|
-
#
|
1944
|
-
# @example
|
1945
|
-
# # bad
|
1946
|
-
# refute(obj.one?)
|
1947
|
-
# refute(obj.one?, 'message')
|
1948
|
-
#
|
1949
|
-
# # good
|
1950
|
-
# refute_predicate(obj, :one?)
|
1951
|
-
# refute_predicate(obj, :one?, 'message')
|
1952
|
-
#
|
1953
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_predicate.rb#18
|
1954
|
-
class RuboCop::Cop::Minitest::RefutePredicate < ::RuboCop::Cop::Base
|
1955
|
-
include ::RuboCop::Cop::RangeHelp
|
1956
|
-
include ::RuboCop::Cop::ArgumentRangeHelper
|
1957
|
-
include ::RuboCop::Cop::Minitest::PredicateAssertionHandleable
|
1958
|
-
extend ::RuboCop::Cop::AutoCorrector
|
1959
|
-
|
1960
|
-
private
|
1961
|
-
|
1962
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_predicate.rb#28
|
1963
|
-
def assertion_type; end
|
1964
|
-
end
|
1965
|
-
|
1966
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_predicate.rb#23
|
1967
|
-
RuboCop::Cop::Minitest::RefutePredicate::MSG = T.let(T.unsafe(nil), String)
|
1968
|
-
|
1969
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_predicate.rb#24
|
1970
|
-
RuboCop::Cop::Minitest::RefutePredicate::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
1971
|
-
|
1972
|
-
# Enforces the test to use `refute_respond_to(object, :do_something)`
|
1973
|
-
# over `refute(object.respond_to?(:do_something))`.
|
1974
|
-
#
|
1975
|
-
# @example
|
1976
|
-
# # bad
|
1977
|
-
# refute(object.respond_to?(:do_something))
|
1978
|
-
# refute(object.respond_to?(:do_something), 'message')
|
1979
|
-
# refute(respond_to?(:do_something))
|
1980
|
-
#
|
1981
|
-
# # good
|
1982
|
-
# refute_respond_to(object, :do_something)
|
1983
|
-
# refute_respond_to(object, :do_something, 'message')
|
1984
|
-
# refute_respond_to(self, :do_something)
|
1985
|
-
#
|
1986
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_respond_to.rb#20
|
1987
|
-
class RuboCop::Cop::Minitest::RefuteRespondTo < ::RuboCop::Cop::Base
|
1988
|
-
include ::RuboCop::Cop::RangeHelp
|
1989
|
-
include ::RuboCop::Cop::ArgumentRangeHelper
|
1990
|
-
extend ::RuboCop::Cop::MinitestCopRule
|
1991
|
-
extend ::RuboCop::Cop::AutoCorrector
|
1992
|
-
|
1993
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#57
|
1994
|
-
def autocorrect(corrector, node, arguments); end
|
1995
|
-
|
1996
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#46
|
1997
|
-
def on_send(node); end
|
1998
|
-
|
1999
|
-
private
|
2000
|
-
|
2001
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#95
|
2002
|
-
def correct_receiver(receiver); end
|
2003
|
-
|
2004
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#81
|
2005
|
-
def new_arguments(arguments); end
|
2006
|
-
|
2007
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#67
|
2008
|
-
def offense_message(arguments); end
|
2009
|
-
end
|
2010
|
-
|
2011
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#43
|
2012
|
-
RuboCop::Cop::Minitest::RefuteRespondTo::MSG = T.let(T.unsafe(nil), String)
|
2013
|
-
|
2014
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#44
|
2015
|
-
RuboCop::Cop::Minitest::RefuteRespondTo::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
2016
|
-
|
2017
|
-
# Enforces the use of `refute_same(expected, object)`
|
2018
|
-
# over `refute(expected.equal?(actual))`.
|
2019
|
-
#
|
2020
|
-
# NOTE: Use `refute_same` only when there is a need to compare by identity.
|
2021
|
-
# Otherwise, use `refute_equal`.
|
2022
|
-
#
|
2023
|
-
# @example
|
2024
|
-
# # bad
|
2025
|
-
# refute(expected.equal?(actual))
|
2026
|
-
# refute_equal(expected.object_id, actual.object_id)
|
2027
|
-
#
|
2028
|
-
# # good
|
2029
|
-
# refute_same(expected, actual)
|
2030
|
-
#
|
2031
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_same.rb#20
|
2032
|
-
class RuboCop::Cop::Minitest::RefuteSame < ::RuboCop::Cop::Base
|
2033
|
-
extend ::RuboCop::Cop::AutoCorrector
|
2034
|
-
|
2035
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_same.rb#40
|
2036
|
-
def on_send(node); end
|
2037
|
-
|
2038
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_same.rb#32
|
2039
|
-
def refute_equal_with_object_id?(param0 = T.unsafe(nil)); end
|
2040
|
-
|
2041
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_same.rb#26
|
2042
|
-
def refute_with_equal?(param0 = T.unsafe(nil)); end
|
2043
|
-
|
2044
|
-
private
|
2045
|
-
|
2046
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_same.rb#58
|
2047
|
-
def message(expected_node, actual_node, message_node); end
|
2048
|
-
|
2049
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_same.rb#63
|
2050
|
-
def remove_method_call(send_node, corrector); end
|
2051
|
-
end
|
2052
|
-
|
2053
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_same.rb#23
|
2054
|
-
RuboCop::Cop::Minitest::RefuteSame::MSG = T.let(T.unsafe(nil), String)
|
2055
|
-
|
2056
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/refute_same.rb#24
|
2057
|
-
RuboCop::Cop::Minitest::RefuteSame::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
2058
|
-
|
2059
|
-
# Enforces the use of `skip` instead of `return` in test methods.
|
2060
|
-
#
|
2061
|
-
# @example
|
2062
|
-
# # bad
|
2063
|
-
# def test_something
|
2064
|
-
# return if condition?
|
2065
|
-
# assert_equal(42, something)
|
2066
|
-
# end
|
2067
|
-
#
|
2068
|
-
# # good
|
2069
|
-
# def test_something
|
2070
|
-
# skip if condition?
|
2071
|
-
# assert_equal(42, something)
|
2072
|
-
# end
|
2073
|
-
#
|
2074
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/return_in_test_method.rb#21
|
2075
|
-
class RuboCop::Cop::Minitest::ReturnInTestMethod < ::RuboCop::Cop::Base
|
2076
|
-
include ::RuboCop::Cop::VisibilityHelp
|
2077
|
-
include ::RuboCop::Cop::DefNode
|
2078
|
-
include ::RuboCop::Cop::MinitestExplorationHelpers
|
2079
|
-
extend ::RuboCop::Cop::AutoCorrector
|
2080
|
-
|
2081
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/return_in_test_method.rb#27
|
2082
|
-
def on_return(node); end
|
2083
|
-
|
2084
|
-
private
|
2085
|
-
|
2086
|
-
# @return [Boolean]
|
2087
|
-
#
|
2088
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/return_in_test_method.rb#38
|
2089
|
-
def inside_block?(node); end
|
2090
|
-
end
|
2091
|
-
|
2092
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/return_in_test_method.rb#25
|
2093
|
-
RuboCop::Cop::Minitest::ReturnInTestMethod::MSG = T.let(T.unsafe(nil), String)
|
2094
|
-
|
2095
|
-
# Checks that `ensure` call even if `skip`. It is unexpected that `ensure` will be called when skipping test.
|
2096
|
-
# If conditional `skip` is used, it checks that `ensure` is also called conditionally.
|
2097
|
-
#
|
2098
|
-
# On the other hand, it accepts `skip` used in `rescue` because `ensure` may be teardown process to `begin`
|
2099
|
-
# setup process.
|
2100
|
-
#
|
2101
|
-
# @example
|
2102
|
-
#
|
2103
|
-
# # bad
|
2104
|
-
# def test_skip
|
2105
|
-
# skip 'This test is skipped.'
|
2106
|
-
#
|
2107
|
-
# assert 'foo'.present?
|
2108
|
-
# ensure
|
2109
|
-
# do_something
|
2110
|
-
# end
|
2111
|
-
#
|
2112
|
-
# # bad
|
2113
|
-
# def test_conditional_skip
|
2114
|
-
# skip 'This test is skipped.' if condition
|
2115
|
-
#
|
2116
|
-
# assert do_something
|
2117
|
-
# ensure
|
2118
|
-
# do_teardown
|
2119
|
-
# end
|
2120
|
-
#
|
2121
|
-
# # good
|
2122
|
-
# def test_skip
|
2123
|
-
# skip 'This test is skipped.'
|
2124
|
-
#
|
2125
|
-
# begin
|
2126
|
-
# assert 'foo'.present?
|
2127
|
-
# ensure
|
2128
|
-
# do_something
|
2129
|
-
# end
|
2130
|
-
# end
|
2131
|
-
#
|
2132
|
-
# # good
|
2133
|
-
# def test_conditional_skip
|
2134
|
-
# skip 'This test is skipped.' if condition
|
2135
|
-
#
|
2136
|
-
# assert do_something
|
2137
|
-
# ensure
|
2138
|
-
# if condition
|
2139
|
-
# do_teardown
|
2140
|
-
# end
|
2141
|
-
# end
|
2142
|
-
#
|
2143
|
-
# # good
|
2144
|
-
# def test_skip_is_used_in_rescue
|
2145
|
-
# do_setup
|
2146
|
-
# assert do_something
|
2147
|
-
# rescue
|
2148
|
-
# skip 'This test is skipped.'
|
2149
|
-
# ensure
|
2150
|
-
# do_teardown
|
2151
|
-
# end
|
2152
|
-
#
|
2153
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/skip_ensure.rb#64
|
2154
|
-
class RuboCop::Cop::Minitest::SkipEnsure < ::RuboCop::Cop::Base
|
2155
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/skip_ensure.rb#67
|
2156
|
-
def on_ensure(node); end
|
2157
|
-
|
2158
|
-
private
|
2159
|
-
|
2160
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/skip_ensure.rb#77
|
2161
|
-
def find_skip(node); end
|
2162
|
-
|
2163
|
-
# @return [Boolean]
|
2164
|
-
#
|
2165
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/skip_ensure.rb#81
|
2166
|
-
def use_skip_in_rescue?(skip_method); end
|
2167
|
-
|
2168
|
-
# @return [Boolean]
|
2169
|
-
#
|
2170
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/skip_ensure.rb#85
|
2171
|
-
def valid_conditional_skip?(skip_method, ensure_node); end
|
2172
|
-
end
|
2173
|
-
|
2174
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/skip_ensure.rb#65
|
2175
|
-
RuboCop::Cop::Minitest::SkipEnsure::MSG = T.let(T.unsafe(nil), String)
|
2176
|
-
|
2177
|
-
# Checks for skipped tests missing the skipping reason.
|
2178
|
-
#
|
2179
|
-
# @example
|
2180
|
-
# # bad
|
2181
|
-
# skip
|
2182
|
-
# skip('')
|
2183
|
-
#
|
2184
|
-
# # bad
|
2185
|
-
# if condition?
|
2186
|
-
# skip
|
2187
|
-
# else
|
2188
|
-
# skip
|
2189
|
-
# end
|
2190
|
-
#
|
2191
|
-
# # good
|
2192
|
-
# skip("Reason why the test was skipped")
|
2193
|
-
#
|
2194
|
-
# # good
|
2195
|
-
# skip if condition?
|
2196
|
-
#
|
2197
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/skip_without_reason.rb#26
|
2198
|
-
class RuboCop::Cop::Minitest::SkipWithoutReason < ::RuboCop::Cop::Base
|
2199
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/skip_without_reason.rb#31
|
2200
|
-
def on_send(node); end
|
2201
|
-
|
2202
|
-
private
|
2203
|
-
|
2204
|
-
# @return [Boolean]
|
2205
|
-
#
|
2206
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/skip_without_reason.rb#44
|
2207
|
-
def blank_argument?(node); end
|
2208
|
-
|
2209
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/skip_without_reason.rb#49
|
2210
|
-
def conditional_parent(node); end
|
2211
|
-
|
2212
|
-
# @return [Boolean]
|
2213
|
-
#
|
2214
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/skip_without_reason.rb#59
|
2215
|
-
def only_skip_branches?(node); end
|
2216
|
-
end
|
2217
|
-
|
2218
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/skip_without_reason.rb#27
|
2219
|
-
RuboCop::Cop::Minitest::SkipWithoutReason::MSG = T.let(T.unsafe(nil), String)
|
2220
|
-
|
2221
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/skip_without_reason.rb#29
|
2222
|
-
RuboCop::Cop::Minitest::SkipWithoutReason::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
2223
|
-
|
2224
|
-
# Checks if test file names start with `test_` or end with `_test.rb`.
|
2225
|
-
# Files which define classes having names ending with `Test` are checked.
|
2226
|
-
# Not following this convention may result in tests not being run.
|
2227
|
-
#
|
2228
|
-
# @example
|
2229
|
-
# # bad
|
2230
|
-
# my_class.rb
|
2231
|
-
#
|
2232
|
-
# # good
|
2233
|
-
# my_class_test.rb
|
2234
|
-
# test_my_class.rb
|
2235
|
-
#
|
2236
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/test_file_name.rb#18
|
2237
|
-
class RuboCop::Cop::Minitest::TestFileName < ::RuboCop::Cop::Base
|
2238
|
-
include ::RuboCop::Cop::VisibilityHelp
|
2239
|
-
include ::RuboCop::Cop::DefNode
|
2240
|
-
include ::RuboCop::Cop::MinitestExplorationHelpers
|
2241
|
-
|
2242
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/test_file_name.rb#23
|
2243
|
-
def on_new_investigation; end
|
2244
|
-
|
2245
|
-
private
|
2246
|
-
|
2247
|
-
# @return [Boolean]
|
2248
|
-
#
|
2249
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/test_file_name.rb#32
|
2250
|
-
def test_file?(node); end
|
2251
|
-
|
2252
|
-
# @return [Boolean]
|
2253
|
-
#
|
2254
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/test_file_name.rb#38
|
2255
|
-
def valid_file_name?; end
|
2256
|
-
end
|
2257
|
-
|
2258
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/test_file_name.rb#21
|
2259
|
-
RuboCop::Cop::Minitest::TestFileName::MSG = T.let(T.unsafe(nil), String)
|
2260
|
-
|
2261
|
-
# Enforces that test method names start with `test_` prefix.
|
2262
|
-
# It aims to prevent tests that aren't executed by forgetting to start test method name with `test_`.
|
2263
|
-
#
|
2264
|
-
# @example
|
2265
|
-
# # bad
|
2266
|
-
# class FooTest < Minitest::Test
|
2267
|
-
# def does_something
|
2268
|
-
# assert_equal 42, do_something
|
2269
|
-
# end
|
2270
|
-
# end
|
2271
|
-
#
|
2272
|
-
# # good
|
2273
|
-
# class FooTest < Minitest::Test
|
2274
|
-
# def test_does_something
|
2275
|
-
# assert_equal 42, do_something
|
2276
|
-
# end
|
2277
|
-
# end
|
2278
|
-
#
|
2279
|
-
# # good
|
2280
|
-
# class FooTest < Minitest::Test
|
2281
|
-
# def helper_method(argument)
|
2282
|
-
# end
|
2283
|
-
# end
|
2284
|
-
#
|
2285
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/test_method_name.rb#30
|
2286
|
-
class RuboCop::Cop::Minitest::TestMethodName < ::RuboCop::Cop::Base
|
2287
|
-
include ::RuboCop::Cop::VisibilityHelp
|
2288
|
-
include ::RuboCop::Cop::DefNode
|
2289
|
-
include ::RuboCop::Cop::MinitestExplorationHelpers
|
2290
|
-
extend ::RuboCop::Cop::AutoCorrector
|
2291
|
-
|
2292
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/test_method_name.rb#37
|
2293
|
-
def on_class(class_node); end
|
2294
|
-
|
2295
|
-
private
|
2296
|
-
|
2297
|
-
# @return [Boolean]
|
2298
|
-
#
|
2299
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/test_method_name.rb#53
|
2300
|
-
def offense?(node); end
|
2301
|
-
|
2302
|
-
# @return [Boolean]
|
2303
|
-
#
|
2304
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/test_method_name.rb#59
|
2305
|
-
def public?(node); end
|
2306
|
-
|
2307
|
-
# @return [Boolean]
|
2308
|
-
#
|
2309
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/test_method_name.rb#63
|
2310
|
-
def test_method_name?(node); end
|
2311
|
-
end
|
2312
|
-
|
2313
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/test_method_name.rb#35
|
2314
|
-
RuboCop::Cop::Minitest::TestMethodName::MSG = T.let(T.unsafe(nil), String)
|
2315
|
-
|
2316
|
-
# Checks for `assert_raises` has an assertion method at
|
2317
|
-
# the bottom of block because the assertion will be never reached.
|
2318
|
-
#
|
2319
|
-
# @example
|
2320
|
-
#
|
2321
|
-
# # bad
|
2322
|
-
# assert_raises FooError do
|
2323
|
-
# obj.occur_error
|
2324
|
-
# assert_equal('foo', obj.bar) # Never asserted.
|
2325
|
-
# end
|
2326
|
-
#
|
2327
|
-
# # good
|
2328
|
-
# assert_raises FooError do
|
2329
|
-
# obj.occur_error
|
2330
|
-
# end
|
2331
|
-
# assert_equal('foo', obj.bar)
|
2332
|
-
#
|
2333
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/unreachable_assertion.rb#23
|
2334
|
-
class RuboCop::Cop::Minitest::UnreachableAssertion < ::RuboCop::Cop::Base
|
2335
|
-
include ::RuboCop::Cop::VisibilityHelp
|
2336
|
-
include ::RuboCop::Cop::DefNode
|
2337
|
-
include ::RuboCop::Cop::MinitestExplorationHelpers
|
2338
|
-
|
2339
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/unreachable_assertion.rb#28
|
2340
|
-
def on_block(node); end
|
2341
|
-
end
|
2342
|
-
|
2343
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/unreachable_assertion.rb#26
|
2344
|
-
RuboCop::Cop::Minitest::UnreachableAssertion::MSG = T.let(T.unsafe(nil), String)
|
2345
|
-
|
2346
|
-
# Checks for a specified error in `assert_raises`.
|
2347
|
-
#
|
2348
|
-
# @example
|
2349
|
-
# # bad
|
2350
|
-
# assert_raises { raise FooException }
|
2351
|
-
# assert_raises('This should have raised') { raise FooException }
|
2352
|
-
#
|
2353
|
-
# # good
|
2354
|
-
# assert_raises(FooException) { raise FooException }
|
2355
|
-
# assert_raises(FooException, 'This should have raised') { raise FooException }
|
2356
|
-
#
|
2357
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/unspecified_exception.rb#17
|
2358
|
-
class RuboCop::Cop::Minitest::UnspecifiedException < ::RuboCop::Cop::Base
|
2359
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/unspecified_exception.rb#20
|
2360
|
-
def on_block(block_node); end
|
2361
|
-
|
2362
|
-
private
|
2363
|
-
|
2364
|
-
# @return [Boolean]
|
2365
|
-
#
|
2366
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/unspecified_exception.rb#29
|
2367
|
-
def unspecified_exception?(node); end
|
2368
|
-
end
|
2369
|
-
|
2370
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/unspecified_exception.rb#18
|
2371
|
-
RuboCop::Cop::Minitest::UnspecifiedException::MSG = T.let(T.unsafe(nil), String)
|
2372
|
-
|
2373
|
-
# Detects useless assertions (assertions that either always pass or always fail).
|
2374
|
-
#
|
2375
|
-
# @example
|
2376
|
-
# # bad
|
2377
|
-
# assert true
|
2378
|
-
# assert_equal @foo, @foo
|
2379
|
-
# assert_nil [foo, bar]
|
2380
|
-
#
|
2381
|
-
# # good
|
2382
|
-
# assert something
|
2383
|
-
# assert_equal foo, bar
|
2384
|
-
# assert_nil foo
|
2385
|
-
# assert false, "My message"
|
2386
|
-
#
|
2387
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/useless_assertion.rb#20
|
2388
|
-
class RuboCop::Cop::Minitest::UselessAssertion < ::RuboCop::Cop::Base
|
2389
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/useless_assertion.rb#35
|
2390
|
-
def on_send(node); end
|
2391
|
-
|
2392
|
-
private
|
2393
|
-
|
2394
|
-
# @return [Boolean]
|
2395
|
-
#
|
2396
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/useless_assertion.rb#67
|
2397
|
-
def empty_composite?(node); end
|
2398
|
-
|
2399
|
-
# @return [Boolean]
|
2400
|
-
#
|
2401
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/useless_assertion.rb#44
|
2402
|
-
def offense?(node); end
|
2403
|
-
end
|
2404
|
-
|
2405
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/useless_assertion.rb#21
|
2406
|
-
RuboCop::Cop::Minitest::UselessAssertion::MSG = T.let(T.unsafe(nil), String)
|
2407
|
-
|
2408
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/useless_assertion.rb#31
|
2409
|
-
RuboCop::Cop::Minitest::UselessAssertion::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
2410
|
-
|
2411
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/useless_assertion.rb#23
|
2412
|
-
RuboCop::Cop::Minitest::UselessAssertion::SINGLE_ASSERTION_ARGUMENT_METHODS = T.let(T.unsafe(nil), Array)
|
2413
|
-
|
2414
|
-
# source://rubocop-minitest//lib/rubocop/cop/minitest/useless_assertion.rb#26
|
2415
|
-
RuboCop::Cop::Minitest::UselessAssertion::TWO_ASSERTION_ARGUMENTS_METHODS = T.let(T.unsafe(nil), Array)
|
2416
|
-
|
2417
|
-
# Provide a method to define offense rule for Minitest cops.
|
2418
|
-
#
|
2419
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#6
|
2420
|
-
module RuboCop::Cop::MinitestCopRule
|
2421
|
-
# Define offense rule for Minitest cops.
|
2422
|
-
#
|
2423
|
-
# @api private
|
2424
|
-
# @example
|
2425
|
-
# define_rule :assert, target_method: :match
|
2426
|
-
# define_rule :refute, target_method: :match
|
2427
|
-
# define_rule :assert, target_method: :include?, preferred_method: :assert_includes
|
2428
|
-
# define_rule :assert, target_method: :instance_of?, inverse: true
|
2429
|
-
# @example Multiple target methods
|
2430
|
-
# # `preferred_method` is required
|
2431
|
-
# define_rule :assert, target_method: %i[match match? =~],
|
2432
|
-
# preferred_method: :assert_match, inverse: 'regexp_type?'
|
2433
|
-
# @param assertion_method [Symbol] Assertion method like `assert` or `refute`.
|
2434
|
-
# @param target_method [Symbol, Array<Symbol>] Method name(s) offensed by assertion method arguments.
|
2435
|
-
# @param preferred_method [Symbol] Is required if passing multiple target methods. Custom method name replaced by
|
2436
|
-
# autocorrection. The preferred method name that connects
|
2437
|
-
# `assertion_method` and `target_method` with `_` is
|
2438
|
-
# the default name.
|
2439
|
-
# @param inverse [Boolean, String] An optional param. Order of arguments replaced by autocorrection.
|
2440
|
-
# If string is passed, it becomes a predicate method for the first argument node.
|
2441
|
-
#
|
2442
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#31
|
2443
|
-
def define_rule(assertion_method, target_method:, preferred_method: T.unsafe(nil), inverse: T.unsafe(nil)); end
|
2444
|
-
end
|
2445
|
-
|
2446
|
-
# Helper methods for different explorations against test files and test cases.
|
2447
|
-
#
|
2448
|
-
# @api private
|
2449
|
-
#
|
2450
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_exploration_helpers.rb#9
|
2451
|
-
module RuboCop::Cop::MinitestExplorationHelpers
|
2452
|
-
include ::RuboCop::Cop::VisibilityHelp
|
2453
|
-
include ::RuboCop::Cop::DefNode
|
2454
|
-
extend ::RuboCop::AST::NodePattern::Macros
|
2455
|
-
|
2456
|
-
private
|
2457
|
-
|
2458
|
-
# @api private
|
2459
|
-
# @return [Boolean]
|
2460
|
-
#
|
2461
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_exploration_helpers.rb#103
|
2462
|
-
def assertion_method?(node); end
|
2463
|
-
|
2464
|
-
# @api private
|
2465
|
-
#
|
2466
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_exploration_helpers.rb#82
|
2467
|
-
def assertions(def_node); end
|
2468
|
-
|
2469
|
-
# @api private
|
2470
|
-
#
|
2471
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_exploration_helpers.rb#96
|
2472
|
-
def assertions_count(node); end
|
2473
|
-
|
2474
|
-
# @api private
|
2475
|
-
#
|
2476
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_exploration_helpers.rb#67
|
2477
|
-
def class_def_nodes(class_node); end
|
2478
|
-
|
2479
|
-
# @api private
|
2480
|
-
# @return [Boolean]
|
2481
|
-
#
|
2482
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_exploration_helpers.rb#116
|
2483
|
-
def lifecycle_hook_method?(node); end
|
2484
|
-
|
2485
|
-
# @api private
|
2486
|
-
#
|
2487
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_exploration_helpers.rb#62
|
2488
|
-
def lifecycle_hooks(class_node); end
|
2489
|
-
|
2490
|
-
# @api private
|
2491
|
-
# @return [Boolean]
|
2492
|
-
#
|
2493
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_exploration_helpers.rb#58
|
2494
|
-
def test_block?(block_node); end
|
2495
|
-
|
2496
|
-
# @api private
|
2497
|
-
# @return [Boolean]
|
2498
|
-
#
|
2499
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_exploration_helpers.rb#32
|
2500
|
-
def test_case?(node); end
|
2501
|
-
|
2502
|
-
# @api private
|
2503
|
-
# @return [Boolean]
|
2504
|
-
#
|
2505
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_exploration_helpers.rb#78
|
2506
|
-
def test_case_name?(name); end
|
2507
|
-
|
2508
|
-
# @api private
|
2509
|
-
#
|
2510
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_exploration_helpers.rb#40
|
2511
|
-
def test_cases(class_node, visibility_check: T.unsafe(nil)); end
|
2512
|
-
|
2513
|
-
# @api private
|
2514
|
-
# @return [Boolean]
|
2515
|
-
#
|
2516
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_exploration_helpers.rb#28
|
2517
|
-
def test_class?(class_node); end
|
2518
|
-
|
2519
|
-
# @api private
|
2520
|
-
# @return [Boolean]
|
2521
|
-
#
|
2522
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_exploration_helpers.rb#52
|
2523
|
-
def test_method?(def_node, visibility_check: T.unsafe(nil)); end
|
2524
|
-
end
|
2525
|
-
|
2526
|
-
# @api private
|
2527
|
-
#
|
2528
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_exploration_helpers.rb#13
|
2529
|
-
RuboCop::Cop::MinitestExplorationHelpers::ASSERTION_PREFIXES = T.let(T.unsafe(nil), Array)
|
2530
|
-
|
2531
|
-
# @api private
|
2532
|
-
#
|
2533
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_exploration_helpers.rb#24
|
2534
|
-
RuboCop::Cop::MinitestExplorationHelpers::LIFECYCLE_HOOK_METHODS = T.let(T.unsafe(nil), Set)
|
2535
|
-
|
2536
|
-
# @api private
|
2537
|
-
#
|
2538
|
-
# source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_exploration_helpers.rb#15
|
2539
|
-
RuboCop::Cop::MinitestExplorationHelpers::LIFECYCLE_HOOK_METHODS_IN_ORDER = T.let(T.unsafe(nil), Array)
|
2540
|
-
|
2541
|
-
# RuboCop minitest project namespace
|
2542
|
-
#
|
2543
|
-
# source://rubocop-minitest//lib/rubocop/minitest.rb#5
|
2544
|
-
module RuboCop::Minitest; end
|
2545
|
-
|
2546
|
-
# source://rubocop-minitest//lib/rubocop/minitest.rb#8
|
2547
|
-
RuboCop::Minitest::CONFIG = T.let(T.unsafe(nil), Hash)
|
2548
|
-
|
2549
|
-
# source://rubocop-minitest//lib/rubocop/minitest.rb#7
|
2550
|
-
RuboCop::Minitest::CONFIG_DEFAULT = T.let(T.unsafe(nil), Pathname)
|
2551
|
-
|
2552
|
-
# Because RuboCop doesn't yet support plugins, we have to monkey patch in a
|
2553
|
-
# bit of our configuration.
|
2554
|
-
#
|
2555
|
-
# source://rubocop-minitest//lib/rubocop/minitest/inject.rb#7
|
2556
|
-
module RuboCop::Minitest::Inject
|
2557
|
-
class << self
|
2558
|
-
# source://rubocop-minitest//lib/rubocop/minitest/inject.rb#8
|
2559
|
-
def defaults!; end
|
2560
|
-
end
|
2561
|
-
end
|
2562
|
-
|
2563
|
-
# source://rubocop-minitest//lib/rubocop/minitest.rb#6
|
2564
|
-
RuboCop::Minitest::PROJECT_ROOT = T.let(T.unsafe(nil), Pathname)
|
2565
|
-
|
2566
|
-
# This module holds the RuboCop Minitest version information.
|
2567
|
-
#
|
2568
|
-
# source://rubocop-minitest//lib/rubocop/minitest/version.rb#6
|
2569
|
-
module RuboCop::Minitest::Version
|
2570
|
-
class << self
|
2571
|
-
# source://rubocop-minitest//lib/rubocop/minitest/version.rb#9
|
2572
|
-
def document_version; end
|
2573
|
-
end
|
2574
|
-
end
|
2575
|
-
|
2576
|
-
# source://rubocop-minitest//lib/rubocop/minitest/version.rb#7
|
2577
|
-
RuboCop::Minitest::Version::STRING = T.let(T.unsafe(nil), String)
|