rubocop-rspec 1.39.0 → 1.43.1
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/CHANGELOG.md +47 -0
- data/CODE_OF_CONDUCT.md +17 -0
- data/README.md +1 -61
- data/config/default.yml +148 -20
- data/lib/rubocop-rspec.rb +4 -1
- data/lib/rubocop/cop/rspec/align_left_let_brace.rb +12 -19
- data/lib/rubocop/cop/rspec/align_right_let_brace.rb +12 -19
- data/lib/rubocop/cop/rspec/any_instance.rb +1 -1
- data/lib/rubocop/cop/rspec/around_block.rb +1 -1
- data/lib/rubocop/cop/rspec/base.rb +74 -0
- data/lib/rubocop/cop/rspec/be.rb +2 -2
- data/lib/rubocop/cop/rspec/be_eql.rb +6 -6
- data/lib/rubocop/cop/rspec/before_after_all.rb +1 -1
- data/lib/rubocop/cop/rspec/capybara/current_path_expectation.rb +19 -17
- data/lib/rubocop/cop/rspec/capybara/feature_methods.rb +14 -12
- data/lib/rubocop/cop/rspec/capybara/visibility_matcher.rb +27 -12
- data/lib/rubocop/cop/rspec/context_method.rb +7 -9
- data/lib/rubocop/cop/rspec/context_wording.rb +3 -3
- data/lib/rubocop/cop/rspec/cop.rb +2 -86
- data/lib/rubocop/cop/rspec/describe_class.rb +20 -27
- data/lib/rubocop/cop/rspec/describe_method.rb +14 -6
- data/lib/rubocop/cop/rspec/describe_symbol.rb +2 -2
- data/lib/rubocop/cop/rspec/described_class.rb +12 -9
- data/lib/rubocop/cop/rspec/described_class_module_wrapping.rb +1 -1
- data/lib/rubocop/cop/rspec/dialect.rb +5 -12
- data/lib/rubocop/cop/rspec/empty_example_group.rb +91 -7
- data/lib/rubocop/cop/rspec/empty_hook.rb +6 -10
- data/lib/rubocop/cop/rspec/empty_line_after_example.rb +5 -7
- data/lib/rubocop/cop/rspec/empty_line_after_example_group.rb +5 -9
- data/lib/rubocop/cop/rspec/empty_line_after_final_let.rb +8 -8
- data/lib/rubocop/cop/rspec/empty_line_after_hook.rb +5 -9
- data/lib/rubocop/cop/rspec/empty_line_after_subject.rb +6 -6
- data/lib/rubocop/cop/rspec/example_length.rb +1 -1
- data/lib/rubocop/cop/rspec/example_without_description.rb +1 -1
- data/lib/rubocop/cop/rspec/example_wording.rb +10 -11
- data/lib/rubocop/cop/rspec/expect_actual.rb +8 -11
- data/lib/rubocop/cop/rspec/expect_change.rb +10 -35
- data/lib/rubocop/cop/rspec/expect_in_hook.rb +3 -3
- data/lib/rubocop/cop/rspec/expect_output.rb +2 -2
- data/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb +24 -21
- data/lib/rubocop/cop/rspec/factory_bot/create_list.rb +20 -22
- data/lib/rubocop/cop/rspec/factory_bot/factory_class_name.rb +7 -8
- data/lib/rubocop/cop/rspec/file_path.rb +54 -20
- data/lib/rubocop/cop/rspec/focus.rb +7 -11
- data/lib/rubocop/cop/rspec/hook_argument.rb +16 -23
- data/lib/rubocop/cop/rspec/hooks_before_examples.rb +13 -14
- data/lib/rubocop/cop/rspec/implicit_block_expectation.rb +1 -1
- data/lib/rubocop/cop/rspec/implicit_expect.rb +7 -15
- data/lib/rubocop/cop/rspec/implicit_subject.rb +16 -11
- data/lib/rubocop/cop/rspec/instance_spy.rb +18 -12
- data/lib/rubocop/cop/rspec/instance_variable.rb +4 -8
- data/lib/rubocop/cop/rspec/invalid_predicate_matcher.rb +3 -6
- data/lib/rubocop/cop/rspec/it_behaves_like.rb +5 -6
- data/lib/rubocop/cop/rspec/iterated_expectation.rb +1 -1
- data/lib/rubocop/cop/rspec/leading_subject.rb +24 -21
- data/lib/rubocop/cop/rspec/leaky_constant_declaration.rb +2 -5
- data/lib/rubocop/cop/rspec/let_before_examples.rb +13 -11
- data/lib/rubocop/cop/rspec/let_setup.rb +21 -6
- data/lib/rubocop/cop/rspec/message_chain.rb +7 -6
- data/lib/rubocop/cop/rspec/message_expectation.rb +2 -2
- data/lib/rubocop/cop/rspec/message_spies.rb +2 -3
- data/lib/rubocop/cop/rspec/missing_example_group_argument.rb +1 -1
- data/lib/rubocop/cop/rspec/multiple_describes.rb +11 -8
- data/lib/rubocop/cop/rspec/multiple_expectations.rb +7 -11
- data/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb +148 -0
- data/lib/rubocop/cop/rspec/multiple_subjects.rb +18 -19
- data/lib/rubocop/cop/rspec/named_subject.rb +2 -2
- data/lib/rubocop/cop/rspec/nested_groups.rb +12 -13
- data/lib/rubocop/cop/rspec/not_to_not.rb +5 -6
- data/lib/rubocop/cop/rspec/overwriting_setup.rb +1 -1
- data/lib/rubocop/cop/rspec/pending.rb +1 -1
- data/lib/rubocop/cop/rspec/predicate_matcher.rb +32 -69
- data/lib/rubocop/cop/rspec/rails/http_status.rb +7 -9
- data/lib/rubocop/cop/rspec/receive_counts.rb +15 -17
- data/lib/rubocop/cop/rspec/receive_never.rb +12 -12
- data/lib/rubocop/cop/rspec/repeated_description.rb +1 -1
- data/lib/rubocop/cop/rspec/repeated_example.rb +2 -2
- data/lib/rubocop/cop/rspec/repeated_example_group_body.rb +12 -2
- data/lib/rubocop/cop/rspec/repeated_example_group_description.rb +1 -1
- data/lib/rubocop/cop/rspec/return_from_stub.rb +12 -22
- data/lib/rubocop/cop/rspec/scattered_let.rb +8 -11
- data/lib/rubocop/cop/rspec/scattered_setup.rb +1 -1
- data/lib/rubocop/cop/rspec/shared_context.rb +8 -21
- data/lib/rubocop/cop/rspec/shared_examples.rb +7 -9
- data/lib/rubocop/cop/rspec/single_argument_message_chain.rb +15 -18
- data/lib/rubocop/cop/rspec/subject_stub.rb +25 -53
- data/lib/rubocop/cop/rspec/unspecified_exception.rb +1 -1
- data/lib/rubocop/cop/rspec/variable_definition.rb +56 -0
- data/lib/rubocop/cop/rspec/variable_name.rb +66 -0
- data/lib/rubocop/cop/rspec/verified_doubles.rb +1 -1
- data/lib/rubocop/cop/rspec/void_expect.rb +1 -1
- data/lib/rubocop/cop/rspec/yield.rb +14 -11
- data/lib/rubocop/cop/rspec_cops.rb +3 -0
- data/lib/rubocop/rspec/corrector/move_node.rb +7 -5
- data/lib/rubocop/rspec/description_extractor.rb +2 -6
- data/lib/rubocop/rspec/{blank_line_separation.rb → empty_line_separation.rb} +13 -10
- data/lib/rubocop/rspec/example_group.rb +21 -49
- data/lib/rubocop/rspec/factory_bot.rb +7 -1
- data/lib/rubocop/rspec/language.rb +6 -4
- data/lib/rubocop/rspec/language/node_pattern.rb +10 -1
- data/lib/rubocop/rspec/top_level_describe.rb +2 -2
- data/lib/rubocop/rspec/top_level_group.rb +57 -0
- data/lib/rubocop/rspec/variable.rb +16 -0
- data/lib/rubocop/rspec/version.rb +1 -1
- metadata +32 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4a711b9695e84aeeb5dd5775251d1de3bb4e2517e4d9489e4fe8df85095be2d
|
4
|
+
data.tar.gz: 7f45719f6b6f89106003d5af2b4f4add6374b0d558220d9eb10974e9d944a043
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25069ce548603cbea393b93ac9047b3356b3dea575f2007a3f385a88c27c7112f127b3871ea0472fa45a207c08e9d41fb0e9e5702aaa1cb9bb4de21093257212
|
7
|
+
data.tar.gz: 74e4fcf11b03a47c29ef8959fef7faa44215d3177c7184e2e2473f24a9b8cffa3eb71f6e42c9dc8610b159813c63ccde4f17f5a9d858b686082893d8d006ceba
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,43 @@
|
|
2
2
|
|
3
3
|
## Master (Unreleased)
|
4
4
|
|
5
|
+
## 1.43.1 (2020-08-17)
|
6
|
+
|
7
|
+
* Fix `RSpec/FilePath` when checking a file defining e.g. an empty class. ([@bquorning][])
|
8
|
+
|
9
|
+
## 1.43.0 (2020-08-17)
|
10
|
+
|
11
|
+
* Add a new base cop class `::RuboCop::Cop::RSpec::Base`. The old base class `::RuboCop::Cop::RSpec::Cop` is deprecated, and will be removed in the next major release. ([@bquorning][])
|
12
|
+
* Add support for subject detection after includes and example groups in `RSpec/LeadingSubject`. ([@pirj][])
|
13
|
+
* Ignore trailing punctuation in context description prefix. ([@elliterate][])
|
14
|
+
* Relax `RSpec/VariableDefinition` cop so interpolated and multiline strings are accepted even when configured to enforce the `symbol` style. ([@bquorning][])
|
15
|
+
* Fix `RSpec/EmptyExampleGroup` to flag example groups with examples in invalid scopes. ([@mlarraz][])
|
16
|
+
* Fix `RSpec/EmptyExampleGroup` to ignore examples groups with examples defined inside iterators. ([@pirj][])
|
17
|
+
* Improve `RSpec/NestedGroups`, `RSpec/FilePath`, `RSpec/DescribeMethod`, `RSpec/MultipleDescribes`, `RSpec/DescribeClass`'s top-level example group detection. ([@pirj][])
|
18
|
+
* Add detection of `let!` with a block-pass or a string literal to `RSpec/LetSetup`. ([@pirj][])
|
19
|
+
* Add `IgnoredPatterns` configuration option to `RSpec/VariableName`. ([@jtannas][])
|
20
|
+
* Add `RSpec/MultipleMemoizedHelpers` cop. ([@mockdeep][])
|
21
|
+
|
22
|
+
## 1.42.0 (2020-07-09)
|
23
|
+
|
24
|
+
* Update RuboCop dependency to 0.87.0 because of changes to internal APIs. ([@bquorning][], [@Darhazer][])
|
25
|
+
|
26
|
+
## 1.41.0 (2020-07-03)
|
27
|
+
|
28
|
+
* Extend the list of Rails spec types for `RSpec/DescribeClass`. ([@pirj][])
|
29
|
+
* Fix `FactoryBot/AttributeDefinedStatically` to allow `#traits_for_enum` without a block. ([@harrylewis][])
|
30
|
+
* Improve the performance of `FactoryBot/AttributeDefinedStatically`, `RSpec/InstanceVariable`, `RSpec/LetSetup`, `RSpec/NestedGroups` and `RSpec/ReturnFromStub`. ([@andrykonchin][])
|
31
|
+
|
32
|
+
## 1.40.0 (2020-06-11)
|
33
|
+
|
34
|
+
* Add new `RSpec/VariableName` cop. ([@tejasbubane][])
|
35
|
+
* Add new `RSpec/VariableDefinition` cop. ([@tejasbubane][])
|
36
|
+
* Expand `Capybara/VisibilityMatcher` to support more than just `have_selector`. ([@twalpole][])
|
37
|
+
* Add new `SpecSuffixOnly` option to `RSpec/FilePath` cop. ([@zdennis][])
|
38
|
+
* Allow `RSpec/RepeatedExampleGroupBody` to differ only by described_class. ([@robotdana][])
|
39
|
+
* Fix `RSpec/FilePath` detection across sibling directories. ([@rolfschmidt][])
|
40
|
+
* Improve the performance of `RSpec/SubjectStub` by an order of magnitude. ([@andrykonchin][])
|
41
|
+
|
5
42
|
## 1.39.0 (2020-05-01)
|
6
43
|
|
7
44
|
* Fix `RSpec/FilePath` detection when absolute path includes test subject. ([@eitoball][])
|
@@ -503,3 +540,13 @@ Compatibility release so users can upgrade RuboCop to 0.51.0. No new features.
|
|
503
540
|
[@aried3r]: https://github.com/aried3r
|
504
541
|
[@AlexWayfer]: https://github.com/AlexWayfer
|
505
542
|
[@tejasbubane]: https://github.com/tejasbubane
|
543
|
+
[@twalpole]: https://github.com/twalpole
|
544
|
+
[@zdennis]: https://github.com/zdennis
|
545
|
+
[@robotdana]: https://github.com/robotdana
|
546
|
+
[@rolfschmidt]: https://github.com/rolfschmidt
|
547
|
+
[@andrykonchin]: https://github.com/andrykonchin
|
548
|
+
[@harrylewis]: https://github.com/harrylewis
|
549
|
+
[@elliterate]: https://github.com/elliterate
|
550
|
+
[@mlarraz]: https://github.com/mlarraz
|
551
|
+
[@jtannas]: https://github.com/jtannas
|
552
|
+
[@mockdeep]: https://github.com/mockdeep
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# The RuboCop Community Code of Conduct
|
2
|
+
|
3
|
+
**Note:** We have picked the following code of conduct based on [Ruby's own
|
4
|
+
code of conduct](https://www.ruby-lang.org/en/conduct/).
|
5
|
+
|
6
|
+
This document provides a few simple community guidelines for a safe, respectful,
|
7
|
+
productive, and collaborative place for any person who is willing to contribute
|
8
|
+
to the RuboCop community. It applies to all "collaborative spaces", which are
|
9
|
+
defined as community communications channels (such as mailing lists, submitted
|
10
|
+
patches, commit comments, etc.).
|
11
|
+
|
12
|
+
* Participants will be tolerant of opposing views.
|
13
|
+
* Participants must ensure that their language and actions are free of personal
|
14
|
+
attacks and disparaging personal remarks.
|
15
|
+
* When interpreting the words and actions of others, participants should always
|
16
|
+
assume good intentions.
|
17
|
+
* Behaviour which can be reasonably considered harassment will not be tolerated.
|
data/README.md
CHANGED
@@ -67,27 +67,7 @@ rubocop-rspec is available on Code Climate as part of the rubocop engine. [Learn
|
|
67
67
|
|
68
68
|
## Documentation
|
69
69
|
|
70
|
-
You can read more about RuboCop-RSpec in its [official manual](
|
71
|
-
|
72
|
-
## Inspecting files that don't end with `_spec.rb`
|
73
|
-
|
74
|
-
By default, `rubocop-rspec` only inspects code within paths ending in `_spec.rb` or including `spec/`. You can override this setting in your config file by specifying one or more patterns:
|
75
|
-
|
76
|
-
```yaml
|
77
|
-
# Inspect all files
|
78
|
-
AllCops:
|
79
|
-
RSpec:
|
80
|
-
Patterns:
|
81
|
-
- '.+'
|
82
|
-
```
|
83
|
-
|
84
|
-
```yaml
|
85
|
-
# Inspect only files ending with `_test.rb`
|
86
|
-
AllCops:
|
87
|
-
RSpec:
|
88
|
-
Patterns:
|
89
|
-
- '_test.rb$'
|
90
|
-
```
|
70
|
+
You can read more about RuboCop-RSpec in its [official manual](https://docs.rubocop.org/rubocop-rspec).
|
91
71
|
|
92
72
|
## The Cops
|
93
73
|
|
@@ -104,46 +84,6 @@ RSpec/FilePath:
|
|
104
84
|
- spec/my_poorly_named_spec_file.rb
|
105
85
|
```
|
106
86
|
|
107
|
-
## Non-goals of RuboCop RSpec
|
108
|
-
|
109
|
-
### Enforcing `should` vs. `expect` syntax
|
110
|
-
|
111
|
-
Enforcing
|
112
|
-
|
113
|
-
```ruby
|
114
|
-
expect(calculator.compute(line_item)).to eq(5)
|
115
|
-
```
|
116
|
-
|
117
|
-
over
|
118
|
-
|
119
|
-
```ruby
|
120
|
-
calculator.compute(line_item).should == 5
|
121
|
-
```
|
122
|
-
|
123
|
-
is a feature of RSpec itself – you can read about it in the [RSpec Documentation](https://relishapp.com/rspec/rspec-expectations/docs/syntax-configuration#disable-should-syntax)
|
124
|
-
|
125
|
-
### Enforcing an explicit RSpec receiver for top-level methods (disabling monkey patching)
|
126
|
-
|
127
|
-
Enforcing
|
128
|
-
|
129
|
-
```ruby
|
130
|
-
RSpec.describe MyClass do
|
131
|
-
...
|
132
|
-
end
|
133
|
-
```
|
134
|
-
|
135
|
-
over
|
136
|
-
|
137
|
-
```ruby
|
138
|
-
describe MyClass do
|
139
|
-
...
|
140
|
-
end
|
141
|
-
```
|
142
|
-
|
143
|
-
can be achieved using RSpec's `disable_monkey_patching!` method, which you can read more about in the [RSpec Documentation](https://relishapp.com/rspec/rspec-core/v/3-7/docs/configuration/zero-monkey-patching-mode#monkey-patched-methods-are-undefined-with-%60disable-monkey-patching!%60). This will also prevent `should` from being defined on every object in your system.
|
144
|
-
|
145
|
-
Before disabling `should` you will need all your specs to use the `expect` syntax. You can use [Transpec](http://yujinakayama.me/transpec/), which will do the conversion for you.
|
146
|
-
|
147
87
|
## Contributing
|
148
88
|
|
149
89
|
Checkout the [contribution guidelines](.github/CONTRIBUTING.md).
|
data/config/default.yml
CHANGED
@@ -13,31 +13,37 @@ AllCops:
|
|
13
13
|
RSpec/AlignLeftLetBrace:
|
14
14
|
Description: Checks that left braces for adjacent single line lets are aligned.
|
15
15
|
Enabled: false
|
16
|
+
VersionAdded: '1.16'
|
16
17
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/AlignLeftLetBrace
|
17
18
|
|
18
19
|
RSpec/AlignRightLetBrace:
|
19
20
|
Description: Checks that right braces for adjacent single line lets are aligned.
|
20
21
|
Enabled: false
|
22
|
+
VersionAdded: '1.16'
|
21
23
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/AlignRightLetBrace
|
22
24
|
|
23
25
|
RSpec/AnyInstance:
|
24
26
|
Description: Check that instances are not being stubbed globally.
|
25
27
|
Enabled: true
|
28
|
+
VersionAdded: '1.4'
|
26
29
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/AnyInstance
|
27
30
|
|
28
31
|
RSpec/AroundBlock:
|
29
32
|
Description: Checks that around blocks actually run the test.
|
30
33
|
Enabled: true
|
34
|
+
VersionAdded: '1.11'
|
31
35
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/AroundBlock
|
32
36
|
|
33
37
|
RSpec/Be:
|
34
38
|
Description: Check for expectations where `be` is used without argument.
|
35
39
|
Enabled: true
|
40
|
+
VersionAdded: '1.25'
|
36
41
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Be
|
37
42
|
|
38
43
|
RSpec/BeEql:
|
39
44
|
Description: Check for expectations where `be(...)` can replace `eql(...)`.
|
40
45
|
Enabled: true
|
46
|
+
VersionAdded: '1.7'
|
41
47
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/BeEql
|
42
48
|
|
43
49
|
RSpec/BeforeAfterAll:
|
@@ -47,11 +53,13 @@ RSpec/BeforeAfterAll:
|
|
47
53
|
- spec/spec_helper.rb
|
48
54
|
- spec/rails_helper.rb
|
49
55
|
- spec/support/**/*.rb
|
56
|
+
VersionAdded: '1.12'
|
50
57
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/BeforeAfterAll
|
51
58
|
|
52
59
|
RSpec/ContextMethod:
|
53
60
|
Description: "`context` should not be used for specifying methods."
|
54
61
|
Enabled: true
|
62
|
+
VersionAdded: '1.36'
|
55
63
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ContextMethod
|
56
64
|
|
57
65
|
RSpec/ContextWording:
|
@@ -61,86 +69,103 @@ RSpec/ContextWording:
|
|
61
69
|
- when
|
62
70
|
- with
|
63
71
|
- without
|
72
|
+
VersionAdded: '1.20'
|
73
|
+
VersionChanged: 1.20.1
|
64
74
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ContextWording
|
65
75
|
|
66
76
|
RSpec/DescribeClass:
|
67
|
-
Description: Check that the first argument to the top
|
77
|
+
Description: Check that the first argument to the top-level describe is a constant.
|
68
78
|
Enabled: true
|
79
|
+
VersionAdded: '1.0'
|
69
80
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/DescribeClass
|
70
81
|
|
71
82
|
RSpec/DescribeMethod:
|
72
83
|
Description: Checks that the second argument to `describe` specifies a method.
|
73
84
|
Enabled: true
|
85
|
+
VersionAdded: '1.0'
|
74
86
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/DescribeMethod
|
75
87
|
|
76
88
|
RSpec/DescribeSymbol:
|
77
89
|
Description: Avoid describing symbols.
|
78
90
|
Enabled: true
|
91
|
+
VersionAdded: '1.15'
|
79
92
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/DescribeSymbol
|
80
93
|
|
81
94
|
RSpec/DescribedClass:
|
82
95
|
Description: Checks that tests use `described_class`.
|
83
|
-
SkipBlocks: false
|
84
96
|
Enabled: true
|
97
|
+
SkipBlocks: false
|
85
98
|
EnforcedStyle: described_class
|
86
99
|
SupportedStyles:
|
87
100
|
- described_class
|
88
101
|
- explicit
|
102
|
+
SafeAutoCorrect: false
|
103
|
+
VersionAdded: '1.0'
|
104
|
+
VersionChanged: '1.11'
|
89
105
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/DescribedClass
|
90
106
|
|
91
107
|
RSpec/DescribedClassModuleWrapping:
|
92
108
|
Description: Avoid opening modules and defining specs within them.
|
93
109
|
Enabled: false
|
110
|
+
VersionAdded: '1.37'
|
94
111
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/DescribedClassModuleWrapping
|
95
112
|
|
96
113
|
RSpec/Dialect:
|
97
114
|
Description: This cop enforces custom RSpec dialects.
|
98
115
|
Enabled: false
|
99
116
|
PreferredMethods: {}
|
117
|
+
VersionAdded: '1.33'
|
100
118
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Dialect
|
101
119
|
|
102
120
|
RSpec/EmptyExampleGroup:
|
103
121
|
Description: Checks if an example group does not include any tests.
|
104
122
|
Enabled: true
|
105
123
|
CustomIncludeMethods: []
|
124
|
+
VersionAdded: '1.7'
|
106
125
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyExampleGroup
|
107
126
|
|
108
127
|
RSpec/EmptyHook:
|
109
128
|
Description: Checks for empty before and after hooks.
|
110
129
|
Enabled: true
|
111
|
-
VersionAdded: 1.39
|
130
|
+
VersionAdded: '1.39'
|
112
131
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyHook
|
113
132
|
|
114
133
|
RSpec/EmptyLineAfterExample:
|
115
134
|
Description: Checks if there is an empty line after example blocks.
|
116
135
|
Enabled: true
|
117
136
|
AllowConsecutiveOneLiners: true
|
137
|
+
VersionAdded: '1.36'
|
118
138
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyLineAfterExample
|
119
139
|
|
120
140
|
RSpec/EmptyLineAfterExampleGroup:
|
121
141
|
Description: Checks if there is an empty line after example group blocks.
|
122
142
|
Enabled: true
|
143
|
+
VersionAdded: '1.27'
|
123
144
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyLineAfterExampleGroup
|
124
145
|
|
125
146
|
RSpec/EmptyLineAfterFinalLet:
|
126
147
|
Description: Checks if there is an empty line after the last let block.
|
127
148
|
Enabled: true
|
149
|
+
VersionAdded: '1.14'
|
128
150
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyLineAfterFinalLet
|
129
151
|
|
130
152
|
RSpec/EmptyLineAfterHook:
|
131
153
|
Description: Checks if there is an empty line after hook blocks.
|
132
154
|
Enabled: true
|
155
|
+
VersionAdded: '1.27'
|
133
156
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyLineAfterHook
|
134
157
|
|
135
158
|
RSpec/EmptyLineAfterSubject:
|
136
159
|
Description: Checks if there is an empty line after subject block.
|
137
160
|
Enabled: true
|
161
|
+
VersionAdded: '1.14'
|
138
162
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyLineAfterSubject
|
139
163
|
|
140
164
|
RSpec/ExampleLength:
|
141
165
|
Description: Checks for long examples.
|
142
166
|
Enabled: true
|
143
167
|
Max: 5
|
168
|
+
VersionAdded: '1.5'
|
144
169
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExampleLength
|
145
170
|
|
146
171
|
RSpec/ExampleWithoutDescription:
|
@@ -151,6 +176,7 @@ RSpec/ExampleWithoutDescription:
|
|
151
176
|
- always_allow
|
152
177
|
- single_line_only
|
153
178
|
- disallow
|
179
|
+
VersionAdded: '1.22'
|
154
180
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExampleWithoutDescription
|
155
181
|
|
156
182
|
RSpec/ExampleWording:
|
@@ -162,6 +188,8 @@ RSpec/ExampleWording:
|
|
162
188
|
have: has
|
163
189
|
HAVE: HAS
|
164
190
|
IgnoredWords: []
|
191
|
+
VersionAdded: '1.0'
|
192
|
+
VersionChanged: '1.2'
|
165
193
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExampleWording
|
166
194
|
|
167
195
|
RSpec/ExpectActual:
|
@@ -169,6 +197,7 @@ RSpec/ExpectActual:
|
|
169
197
|
Enabled: true
|
170
198
|
Exclude:
|
171
199
|
- spec/routing/**/*
|
200
|
+
VersionAdded: '1.7'
|
172
201
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExpectActual
|
173
202
|
|
174
203
|
RSpec/ExpectChange:
|
@@ -178,30 +207,37 @@ RSpec/ExpectChange:
|
|
178
207
|
SupportedStyles:
|
179
208
|
- method_call
|
180
209
|
- block
|
210
|
+
VersionAdded: '1.22'
|
181
211
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExpectChange
|
182
212
|
|
183
213
|
RSpec/ExpectInHook:
|
184
|
-
Enabled: true
|
185
214
|
Description: Do not use `expect` in hooks such as `before`.
|
215
|
+
Enabled: true
|
216
|
+
VersionAdded: '1.16'
|
186
217
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExpectInHook
|
187
218
|
|
188
219
|
RSpec/ExpectOutput:
|
189
220
|
Description: Checks for opportunities to use `expect { ... }.to output`.
|
190
221
|
Enabled: true
|
222
|
+
VersionAdded: '1.10'
|
191
223
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExpectOutput
|
192
224
|
|
193
225
|
RSpec/FilePath:
|
194
|
-
Description: Checks that spec file paths are consistent
|
226
|
+
Description: Checks that spec file paths are consistent and well-formed.
|
195
227
|
Enabled: true
|
196
228
|
CustomTransform:
|
197
229
|
RuboCop: rubocop
|
198
230
|
RSpec: rspec
|
199
231
|
IgnoreMethods: false
|
232
|
+
SpecSuffixOnly: false
|
233
|
+
VersionAdded: '1.2'
|
234
|
+
VersionChanged: '1.40'
|
200
235
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FilePath
|
201
236
|
|
202
237
|
RSpec/Focus:
|
203
238
|
Description: Checks if examples are focused.
|
204
239
|
Enabled: true
|
240
|
+
VersionAdded: '1.5'
|
205
241
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Focus
|
206
242
|
|
207
243
|
RSpec/HookArgument:
|
@@ -212,16 +248,19 @@ RSpec/HookArgument:
|
|
212
248
|
- implicit
|
213
249
|
- each
|
214
250
|
- example
|
251
|
+
VersionAdded: '1.7'
|
215
252
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/HookArgument
|
216
253
|
|
217
254
|
RSpec/HooksBeforeExamples:
|
218
|
-
Enabled: true
|
219
255
|
Description: Checks for before/around/after hooks that come after an example.
|
256
|
+
Enabled: true
|
257
|
+
VersionAdded: '1.29'
|
220
258
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/HooksBeforeExamples
|
221
259
|
|
222
260
|
RSpec/ImplicitBlockExpectation:
|
223
261
|
Description: Check that implicit block expectation syntax is not used.
|
224
262
|
Enabled: true
|
263
|
+
VersionAdded: '1.35'
|
225
264
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ImplicitBlockExpectation
|
226
265
|
|
227
266
|
RSpec/ImplicitExpect:
|
@@ -231,32 +270,39 @@ RSpec/ImplicitExpect:
|
|
231
270
|
SupportedStyles:
|
232
271
|
- is_expected
|
233
272
|
- should
|
273
|
+
VersionAdded: '1.8'
|
234
274
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ImplicitExpect
|
235
275
|
|
236
276
|
RSpec/ImplicitSubject:
|
237
|
-
Enabled: true
|
238
277
|
Description: Checks for usage of implicit subject (`is_expected` / `should`).
|
278
|
+
Enabled: true
|
239
279
|
EnforcedStyle: single_line_only
|
240
280
|
SupportedStyles:
|
241
281
|
- single_line_only
|
242
282
|
- single_statement_only
|
243
283
|
- disallow
|
284
|
+
VersionAdded: '1.29'
|
285
|
+
VersionChanged: '1.30'
|
244
286
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ImplicitSubject
|
245
287
|
|
246
288
|
RSpec/InstanceSpy:
|
247
289
|
Description: Checks for `instance_double` used with `have_received`.
|
248
290
|
Enabled: true
|
291
|
+
VersionAdded: '1.12'
|
249
292
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/InstanceSpy
|
250
293
|
|
251
294
|
RSpec/InstanceVariable:
|
252
295
|
Description: Checks for instance variable usage in specs.
|
253
|
-
AssignmentOnly: false
|
254
296
|
Enabled: true
|
297
|
+
AssignmentOnly: false
|
298
|
+
VersionAdded: '1.0'
|
299
|
+
VersionChanged: '1.7'
|
255
300
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/InstanceVariable
|
256
301
|
|
257
302
|
RSpec/InvalidPredicateMatcher:
|
258
303
|
Description: Checks invalid usage for predicate matcher.
|
259
304
|
Enabled: true
|
305
|
+
VersionAdded: '1.16'
|
260
306
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/InvalidPredicateMatcher
|
261
307
|
|
262
308
|
RSpec/ItBehavesLike:
|
@@ -266,36 +312,45 @@ RSpec/ItBehavesLike:
|
|
266
312
|
SupportedStyles:
|
267
313
|
- it_behaves_like
|
268
314
|
- it_should_behave_like
|
315
|
+
VersionAdded: '1.13'
|
269
316
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ItBehavesLike
|
270
317
|
|
271
318
|
RSpec/IteratedExpectation:
|
272
319
|
Description: Check that `all` matcher is used instead of iterating over an array.
|
273
320
|
Enabled: true
|
321
|
+
VersionAdded: '1.14'
|
274
322
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/IteratedExpectation
|
275
323
|
|
276
324
|
RSpec/LeadingSubject:
|
277
325
|
Description: Enforce that subject is the first definition in the test.
|
278
326
|
Enabled: true
|
327
|
+
VersionAdded: '1.7'
|
328
|
+
VersionChanged: '1.14'
|
279
329
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/LeadingSubject
|
280
330
|
|
281
331
|
RSpec/LeakyConstantDeclaration:
|
282
332
|
Description: Checks that no class, module, or constant is declared.
|
283
333
|
Enabled: true
|
334
|
+
VersionAdded: '1.35'
|
284
335
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/LeakyConstantDeclaration
|
285
336
|
|
286
337
|
RSpec/LetBeforeExamples:
|
287
338
|
Description: Checks for `let` definitions that come after an example.
|
288
339
|
Enabled: true
|
340
|
+
VersionAdded: '1.16'
|
341
|
+
VersionChanged: '1.22'
|
289
342
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/LetBeforeExamples
|
290
343
|
|
291
344
|
RSpec/LetSetup:
|
292
345
|
Description: Checks unreferenced `let!` calls being used for test setup.
|
293
346
|
Enabled: true
|
347
|
+
VersionAdded: '1.7'
|
294
348
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/LetSetup
|
295
349
|
|
296
350
|
RSpec/MessageChain:
|
297
351
|
Description: Check that chains of messages are not being stubbed.
|
298
352
|
Enabled: true
|
353
|
+
VersionAdded: '1.7'
|
299
354
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MessageChain
|
300
355
|
|
301
356
|
RSpec/MessageExpectation:
|
@@ -305,6 +360,8 @@ RSpec/MessageExpectation:
|
|
305
360
|
SupportedStyles:
|
306
361
|
- allow
|
307
362
|
- expect
|
363
|
+
VersionAdded: '1.7'
|
364
|
+
VersionChanged: '1.8'
|
308
365
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MessageExpectation
|
309
366
|
|
310
367
|
RSpec/MessageSpies:
|
@@ -314,58 +371,78 @@ RSpec/MessageSpies:
|
|
314
371
|
SupportedStyles:
|
315
372
|
- have_received
|
316
373
|
- receive
|
374
|
+
VersionAdded: '1.9'
|
317
375
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MessageSpies
|
318
376
|
|
319
377
|
RSpec/MissingExampleGroupArgument:
|
320
378
|
Description: Checks that the first argument to an example group is not empty.
|
321
379
|
Enabled: true
|
380
|
+
VersionAdded: '1.28'
|
322
381
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MissingExampleGroupArgument
|
323
382
|
|
324
383
|
RSpec/MultipleDescribes:
|
325
|
-
Description: Checks for multiple top
|
384
|
+
Description: Checks for multiple top-level example groups.
|
326
385
|
Enabled: true
|
386
|
+
VersionAdded: '1.0'
|
327
387
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MultipleDescribes
|
328
388
|
|
329
389
|
RSpec/MultipleExpectations:
|
330
390
|
Description: Checks if examples contain too many `expect` calls.
|
331
391
|
Enabled: true
|
332
392
|
Max: 1
|
393
|
+
VersionAdded: '1.7'
|
394
|
+
VersionChanged: '1.21'
|
333
395
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MultipleExpectations
|
334
396
|
|
397
|
+
RSpec/MultipleMemoizedHelpers:
|
398
|
+
Description: Checks if example groups contain too many `let` and `subject` calls.
|
399
|
+
Enabled: true
|
400
|
+
AllowSubject: true
|
401
|
+
Max: 5
|
402
|
+
VersionAdded: '1.43'
|
403
|
+
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MultipleMemoizedHelpers
|
404
|
+
|
335
405
|
RSpec/MultipleSubjects:
|
336
406
|
Description: Checks if an example group defines `subject` multiple times.
|
337
407
|
Enabled: true
|
408
|
+
VersionAdded: '1.16'
|
338
409
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MultipleSubjects
|
339
410
|
|
340
411
|
RSpec/NamedSubject:
|
341
412
|
Description: Checks for explicitly referenced test subjects.
|
342
413
|
Enabled: true
|
343
414
|
IgnoreSharedExamples: true
|
415
|
+
VersionAdded: 1.5.3
|
344
416
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NamedSubject
|
345
417
|
|
346
418
|
RSpec/NestedGroups:
|
347
419
|
Description: Checks for nested example groups.
|
348
420
|
Enabled: true
|
349
421
|
Max: 3
|
422
|
+
VersionAdded: '1.7'
|
423
|
+
VersionChanged: '1.10'
|
350
424
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NestedGroups
|
351
425
|
|
352
426
|
RSpec/NotToNot:
|
353
427
|
Description: Checks for consistent method usage for negating expectations.
|
428
|
+
Enabled: true
|
354
429
|
EnforcedStyle: not_to
|
355
430
|
SupportedStyles:
|
356
431
|
- not_to
|
357
432
|
- to_not
|
358
|
-
|
433
|
+
VersionAdded: '1.4'
|
359
434
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NotToNot
|
360
435
|
|
361
436
|
RSpec/OverwritingSetup:
|
362
|
-
Enabled: true
|
363
437
|
Description: Checks if there is a let/subject that overwrites an existing one.
|
438
|
+
Enabled: true
|
439
|
+
VersionAdded: '1.14'
|
364
440
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/OverwritingSetup
|
365
441
|
|
366
442
|
RSpec/Pending:
|
367
|
-
Enabled: false
|
368
443
|
Description: Checks for any pending or skipped examples.
|
444
|
+
Enabled: false
|
445
|
+
VersionAdded: '1.25'
|
369
446
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Pending
|
370
447
|
|
371
448
|
RSpec/PredicateMatcher:
|
@@ -377,109 +454,156 @@ RSpec/PredicateMatcher:
|
|
377
454
|
SupportedStyles:
|
378
455
|
- inflected
|
379
456
|
- explicit
|
457
|
+
SafeAutoCorrect: false
|
458
|
+
VersionAdded: '1.16'
|
380
459
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/PredicateMatcher
|
381
460
|
|
382
461
|
RSpec/ReceiveCounts:
|
383
|
-
Enabled: true
|
384
462
|
Description: Check for `once` and `twice` receive counts matchers usage.
|
463
|
+
Enabled: true
|
464
|
+
VersionAdded: '1.26'
|
385
465
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ReceiveCounts
|
386
466
|
|
387
467
|
RSpec/ReceiveNever:
|
388
|
-
Enabled: true
|
389
468
|
Description: Prefer `not_to receive(...)` over `receive(...).never`.
|
469
|
+
Enabled: true
|
470
|
+
VersionAdded: '1.28'
|
390
471
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ReceiveNever
|
391
472
|
|
392
473
|
RSpec/RepeatedDescription:
|
393
|
-
Enabled: true
|
394
474
|
Description: Check for repeated description strings in example groups.
|
475
|
+
Enabled: true
|
476
|
+
VersionAdded: '1.9'
|
395
477
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedDescription
|
396
478
|
|
397
479
|
RSpec/RepeatedExample:
|
398
|
-
Enabled: true
|
399
480
|
Description: Check for repeated examples within example groups.
|
481
|
+
Enabled: true
|
482
|
+
VersionAdded: '1.10'
|
400
483
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedExample
|
401
484
|
|
402
485
|
RSpec/RepeatedExampleGroupBody:
|
403
|
-
Enabled: true
|
404
486
|
Description: Check for repeated describe and context block body.
|
487
|
+
Enabled: true
|
488
|
+
VersionAdded: '1.38'
|
405
489
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedExampleGroupBody
|
406
490
|
|
407
491
|
RSpec/RepeatedExampleGroupDescription:
|
408
|
-
Enabled: true
|
409
492
|
Description: Check for repeated example group descriptions.
|
493
|
+
Enabled: true
|
494
|
+
VersionAdded: '1.38'
|
410
495
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedExampleGroupDescription
|
411
496
|
|
412
497
|
RSpec/ReturnFromStub:
|
413
|
-
Enabled: true
|
414
498
|
Description: Checks for consistent style of stub's return setting.
|
499
|
+
Enabled: true
|
415
500
|
EnforcedStyle: and_return
|
416
501
|
SupportedStyles:
|
417
502
|
- and_return
|
418
503
|
- block
|
504
|
+
VersionAdded: '1.16'
|
505
|
+
VersionChanged: '1.22'
|
419
506
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ReturnFromStub
|
420
507
|
|
421
508
|
RSpec/ScatteredLet:
|
422
509
|
Description: Checks for let scattered across the example group.
|
423
510
|
Enabled: true
|
424
|
-
|
511
|
+
VersionAdded: '1.14'
|
425
512
|
VersionChanged: '1.39'
|
513
|
+
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ScatteredLet
|
426
514
|
|
427
515
|
RSpec/ScatteredSetup:
|
428
516
|
Description: Checks for setup scattered across multiple hooks in an example group.
|
429
517
|
Enabled: true
|
518
|
+
VersionAdded: '1.10'
|
430
519
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ScatteredSetup
|
431
520
|
|
432
521
|
RSpec/SharedContext:
|
433
522
|
Description: Checks for proper shared_context and shared_examples usage.
|
434
523
|
Enabled: true
|
524
|
+
VersionAdded: '1.13'
|
435
525
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SharedContext
|
436
526
|
|
437
527
|
RSpec/SharedExamples:
|
438
528
|
Description: Enforces use of string to titleize shared examples.
|
439
529
|
Enabled: true
|
530
|
+
VersionAdded: '1.25'
|
440
531
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SharedExamples
|
441
532
|
|
442
533
|
RSpec/SingleArgumentMessageChain:
|
443
534
|
Description: Checks that chains of messages contain more than one element.
|
444
535
|
Enabled: true
|
536
|
+
VersionAdded: '1.9'
|
537
|
+
VersionChanged: '1.10'
|
445
538
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SingleArgumentMessageChain
|
446
539
|
|
447
540
|
RSpec/SubjectStub:
|
448
541
|
Description: Checks for stubbed test subjects.
|
449
542
|
Enabled: true
|
543
|
+
VersionAdded: '1.7'
|
450
544
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SubjectStub
|
451
545
|
|
452
546
|
RSpec/UnspecifiedException:
|
453
547
|
Description: Checks for a specified error in checking raised errors.
|
454
548
|
Enabled: true
|
549
|
+
VersionAdded: '1.30'
|
455
550
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/UnspecifiedException
|
456
551
|
|
552
|
+
RSpec/VariableDefinition:
|
553
|
+
Description: Checks that memoized helpers names are symbols or strings.
|
554
|
+
Enabled: true
|
555
|
+
EnforcedStyle: symbols
|
556
|
+
SupportedStyles:
|
557
|
+
- symbols
|
558
|
+
- strings
|
559
|
+
VersionAdded: '1.40'
|
560
|
+
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/VariableDefinition
|
561
|
+
|
562
|
+
RSpec/VariableName:
|
563
|
+
Description: Checks that memoized helper names use the configured style.
|
564
|
+
Enabled: true
|
565
|
+
EnforcedStyle: snake_case
|
566
|
+
SupportedStyles:
|
567
|
+
- snake_case
|
568
|
+
- camelCase
|
569
|
+
IgnoredPatterns: []
|
570
|
+
VersionAdded: '1.40'
|
571
|
+
VersionChanged: '1.43'
|
572
|
+
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/VariableName
|
573
|
+
|
457
574
|
RSpec/VerifiedDoubles:
|
458
575
|
Description: Prefer using verifying doubles over normal doubles.
|
459
576
|
Enabled: true
|
460
577
|
IgnoreNameless: true
|
461
578
|
IgnoreSymbolicNames: false
|
579
|
+
VersionAdded: 1.2.1
|
580
|
+
VersionChanged: '1.5'
|
462
581
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/VerifiedDoubles
|
463
582
|
|
464
583
|
RSpec/VoidExpect:
|
465
584
|
Description: This cop checks void `expect()`.
|
466
585
|
Enabled: true
|
586
|
+
VersionAdded: '1.16'
|
467
587
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/VoidExpect
|
468
588
|
|
469
589
|
RSpec/Yield:
|
470
590
|
Description: This cop checks for calling a block within a stub.
|
471
591
|
Enabled: true
|
592
|
+
VersionAdded: '1.32'
|
472
593
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Yield
|
473
594
|
|
474
595
|
Capybara/CurrentPathExpectation:
|
475
596
|
Description: Checks that no expectations are set on Capybara's `current_path`.
|
476
597
|
Enabled: true
|
598
|
+
VersionAdded: '1.18'
|
477
599
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/CurrentPathExpectation
|
478
600
|
|
479
601
|
Capybara/FeatureMethods:
|
480
602
|
Description: Checks for consistent method usage in feature specs.
|
481
603
|
Enabled: true
|
482
604
|
EnabledMethods: []
|
605
|
+
VersionAdded: '1.17'
|
606
|
+
VersionChanged: '1.25'
|
483
607
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/FeatureMethods
|
484
608
|
|
485
609
|
Capybara/VisibilityMatcher:
|
@@ -491,6 +615,7 @@ Capybara/VisibilityMatcher:
|
|
491
615
|
FactoryBot/AttributeDefinedStatically:
|
492
616
|
Description: Always declare attribute values as blocks.
|
493
617
|
Enabled: true
|
618
|
+
VersionAdded: '1.28'
|
494
619
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/AttributeDefinedStatically
|
495
620
|
|
496
621
|
FactoryBot/CreateList:
|
@@ -500,11 +625,13 @@ FactoryBot/CreateList:
|
|
500
625
|
SupportedStyles:
|
501
626
|
- create_list
|
502
627
|
- n_times
|
628
|
+
VersionAdded: '1.25'
|
503
629
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/CreateList
|
504
630
|
|
505
631
|
FactoryBot/FactoryClassName:
|
506
632
|
Description: Use string value when setting the class attribute explicitly.
|
507
633
|
Enabled: true
|
634
|
+
VersionAdded: '1.37'
|
508
635
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/FactoryClassName
|
509
636
|
|
510
637
|
Rails/HttpStatus:
|
@@ -514,4 +641,5 @@ Rails/HttpStatus:
|
|
514
641
|
SupportedStyles:
|
515
642
|
- numeric
|
516
643
|
- symbolic
|
644
|
+
VersionAdded: '1.23'
|
517
645
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/HttpStatus
|