rubocop-rspec 2.12.1 → 2.13.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.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +110 -86
  3. data/config/default.yml +44 -6
  4. data/lib/rubocop/cop/rspec/align_left_let_brace.rb +8 -9
  5. data/lib/rubocop/cop/rspec/align_right_let_brace.rb +8 -9
  6. data/lib/rubocop/cop/rspec/any_instance.rb +1 -0
  7. data/lib/rubocop/cop/rspec/around_block.rb +26 -3
  8. data/lib/rubocop/cop/rspec/be.rb +0 -1
  9. data/lib/rubocop/cop/rspec/be_eq.rb +0 -1
  10. data/lib/rubocop/cop/rspec/be_eql.rb +0 -1
  11. data/lib/rubocop/cop/rspec/before_after_all.rb +1 -0
  12. data/lib/rubocop/cop/rspec/capybara/current_path_expectation.rb +9 -3
  13. data/lib/rubocop/cop/rspec/capybara/feature_methods.rb +2 -1
  14. data/lib/rubocop/cop/rspec/capybara/specific_finders.rb +86 -0
  15. data/lib/rubocop/cop/rspec/capybara/specific_matcher.rb +91 -10
  16. data/lib/rubocop/cop/rspec/capybara/visibility_matcher.rb +0 -1
  17. data/lib/rubocop/cop/rspec/change_by_zero.rb +60 -5
  18. data/lib/rubocop/cop/rspec/class_check.rb +101 -0
  19. data/lib/rubocop/cop/rspec/context_method.rb +2 -1
  20. data/lib/rubocop/cop/rspec/context_wording.rb +49 -18
  21. data/lib/rubocop/cop/rspec/describe_class.rb +1 -1
  22. data/lib/rubocop/cop/rspec/describe_method.rb +1 -0
  23. data/lib/rubocop/cop/rspec/described_class.rb +4 -14
  24. data/lib/rubocop/cop/rspec/dialect.rb +1 -0
  25. data/lib/rubocop/cop/rspec/empty_example_group.rb +19 -4
  26. data/lib/rubocop/cop/rspec/empty_hook.rb +2 -1
  27. data/lib/rubocop/cop/rspec/empty_line_after_example.rb +4 -9
  28. data/lib/rubocop/cop/rspec/empty_line_after_example_group.rb +1 -1
  29. data/lib/rubocop/cop/rspec/empty_line_after_final_let.rb +2 -1
  30. data/lib/rubocop/cop/rspec/empty_line_after_hook.rb +32 -2
  31. data/lib/rubocop/cop/rspec/empty_line_after_subject.rb +2 -1
  32. data/lib/rubocop/cop/rspec/example_length.rb +2 -1
  33. data/lib/rubocop/cop/rspec/example_without_description.rb +2 -1
  34. data/lib/rubocop/cop/rspec/example_wording.rb +2 -1
  35. data/lib/rubocop/cop/rspec/excessive_docstring_spacing.rb +1 -0
  36. data/lib/rubocop/cop/rspec/expect_actual.rb +3 -0
  37. data/lib/rubocop/cop/rspec/expect_change.rb +1 -1
  38. data/lib/rubocop/cop/rspec/expect_in_hook.rb +4 -1
  39. data/lib/rubocop/cop/rspec/expect_output.rb +1 -0
  40. data/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb +2 -1
  41. data/lib/rubocop/cop/rspec/factory_bot/create_list.rb +26 -12
  42. data/lib/rubocop/cop/rspec/factory_bot/factory_class_name.rb +1 -0
  43. data/lib/rubocop/cop/rspec/file_path.rb +6 -3
  44. data/lib/rubocop/cop/rspec/focus.rb +18 -0
  45. data/lib/rubocop/cop/rspec/hook_argument.rb +7 -2
  46. data/lib/rubocop/cop/rspec/hooks_before_examples.rb +10 -9
  47. data/lib/rubocop/cop/rspec/identical_equality_assertion.rb +0 -1
  48. data/lib/rubocop/cop/rspec/implicit_block_expectation.rb +1 -0
  49. data/lib/rubocop/cop/rspec/implicit_expect.rb +0 -2
  50. data/lib/rubocop/cop/rspec/instance_spy.rb +1 -1
  51. data/lib/rubocop/cop/rspec/instance_variable.rb +0 -1
  52. data/lib/rubocop/cop/rspec/it_behaves_like.rb +1 -0
  53. data/lib/rubocop/cop/rspec/iterated_expectation.rb +16 -0
  54. data/lib/rubocop/cop/rspec/leading_subject.rb +15 -15
  55. data/lib/rubocop/cop/rspec/let_before_examples.rb +7 -8
  56. data/lib/rubocop/cop/rspec/let_setup.rb +4 -4
  57. data/lib/rubocop/cop/rspec/message_chain.rb +1 -1
  58. data/lib/rubocop/cop/rspec/missing_example_group_argument.rb +2 -1
  59. data/lib/rubocop/cop/rspec/mixin/css_selector.rb +99 -0
  60. data/lib/rubocop/cop/rspec/mixin/namespace.rb +23 -0
  61. data/lib/rubocop/cop/rspec/multiple_describes.rb +1 -0
  62. data/lib/rubocop/cop/rspec/multiple_expectations.rb +1 -5
  63. data/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb +1 -3
  64. data/lib/rubocop/cop/rspec/multiple_subjects.rb +17 -2
  65. data/lib/rubocop/cop/rspec/named_subject.rb +2 -1
  66. data/lib/rubocop/cop/rspec/nested_groups.rb +45 -25
  67. data/lib/rubocop/cop/rspec/no_expectation_example.rb +64 -0
  68. data/lib/rubocop/cop/rspec/not_to_not.rb +1 -2
  69. data/lib/rubocop/cop/rspec/overwriting_setup.rb +2 -1
  70. data/lib/rubocop/cop/rspec/pending.rb +1 -0
  71. data/lib/rubocop/cop/rspec/predicate_matcher.rb +2 -1
  72. data/lib/rubocop/cop/rspec/rails/avoid_setup_hook.rb +1 -2
  73. data/lib/rubocop/cop/rspec/receive_counts.rb +14 -15
  74. data/lib/rubocop/cop/rspec/receive_never.rb +4 -5
  75. data/lib/rubocop/cop/rspec/repeated_description.rb +25 -26
  76. data/lib/rubocop/cop/rspec/repeated_example.rb +1 -1
  77. data/lib/rubocop/cop/rspec/repeated_example_group_body.rb +28 -29
  78. data/lib/rubocop/cop/rspec/repeated_example_group_description.rb +28 -29
  79. data/lib/rubocop/cop/rspec/repeated_include_example.rb +32 -33
  80. data/lib/rubocop/cop/rspec/return_from_stub.rb +1 -1
  81. data/lib/rubocop/cop/rspec/scattered_let.rb +1 -5
  82. data/lib/rubocop/cop/rspec/scattered_setup.rb +1 -1
  83. data/lib/rubocop/cop/rspec/shared_context.rb +1 -1
  84. data/lib/rubocop/cop/rspec/stubbed_mock.rb +0 -1
  85. data/lib/rubocop/cop/rspec/subject_declaration.rb +0 -1
  86. data/lib/rubocop/cop/rspec/subject_stub.rb +2 -2
  87. data/lib/rubocop/cop/rspec/unspecified_exception.rb +15 -15
  88. data/lib/rubocop/cop/rspec/variable_definition.rb +1 -0
  89. data/lib/rubocop/cop/rspec/variable_name.rb +6 -7
  90. data/lib/rubocop/cop/rspec/verified_doubles.rb +1 -0
  91. data/lib/rubocop/cop/rspec/void_expect.rb +2 -1
  92. data/lib/rubocop/cop/rspec/yield.rb +2 -1
  93. data/lib/rubocop/cop/rspec_cops.rb +3 -0
  94. data/lib/rubocop/rspec/config_formatter.rb +14 -3
  95. data/lib/rubocop/rspec/inject.rb +1 -3
  96. data/lib/rubocop/rspec/language/node_pattern.rb +4 -0
  97. data/lib/rubocop/rspec/language.rb +6 -1
  98. data/lib/rubocop/rspec/version.rb +1 -1
  99. data/lib/rubocop/rspec/wording.rb +2 -2
  100. data/lib/rubocop/rspec.rb +14 -0
  101. data/lib/rubocop-rspec.rb +3 -0
  102. metadata +10 -88
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RuboCop
4
+ # RuboCop RSpec project namespace
5
+ module RSpec
6
+ PROJECT_ROOT = Pathname.new(__dir__).parent.parent.expand_path.freeze
7
+ CONFIG_DEFAULT = PROJECT_ROOT.join('config', 'default.yml').freeze
8
+
9
+ private_constant(:CONFIG_DEFAULT, :PROJECT_ROOT)
10
+
11
+ ::RuboCop::ConfigObsoletion.files << PROJECT_ROOT.join('config',
12
+ 'obsoletion.yml')
13
+ end
14
+ end
data/lib/rubocop-rspec.rb CHANGED
@@ -5,6 +5,7 @@ require 'yaml'
5
5
 
6
6
  require 'rubocop'
7
7
 
8
+ require_relative 'rubocop/rspec'
8
9
  require_relative 'rubocop/rspec/version'
9
10
  require_relative 'rubocop/rspec/inject'
10
11
  require_relative 'rubocop/rspec/node'
@@ -20,6 +21,8 @@ require_relative 'rubocop/cop/rspec/mixin/final_end_location'
20
21
  require_relative 'rubocop/cop/rspec/mixin/comments_help'
21
22
  require_relative 'rubocop/cop/rspec/mixin/empty_line_separation'
22
23
  require_relative 'rubocop/cop/rspec/mixin/inside_example_group'
24
+ require_relative 'rubocop/cop/rspec/mixin/namespace'
25
+ require_relative 'rubocop/cop/rspec/mixin/css_selector'
23
26
 
24
27
  require_relative 'rubocop/rspec/concept'
25
28
  require_relative 'rubocop/rspec/example_group'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.12.1
4
+ version: 2.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Backus
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2022-07-03 00:00:00.000000000 Z
13
+ date: 2022-09-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rubocop
@@ -18,98 +18,14 @@ dependencies:
18
18
  requirements:
19
19
  - - "~>"
20
20
  - !ruby/object:Gem::Version
21
- version: '1.31'
21
+ version: '1.33'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - "~>"
27
27
  - !ruby/object:Gem::Version
28
- version: '1.31'
29
- - !ruby/object:Gem::Dependency
30
- name: rack
31
- requirement: !ruby/object:Gem::Requirement
32
- requirements:
33
- - - ">="
34
- - !ruby/object:Gem::Version
35
- version: '0'
36
- type: :development
37
- prerelease: false
38
- version_requirements: !ruby/object:Gem::Requirement
39
- requirements:
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- version: '0'
43
- - !ruby/object:Gem::Dependency
44
- name: rake
45
- requirement: !ruby/object:Gem::Requirement
46
- requirements:
47
- - - ">="
48
- - !ruby/object:Gem::Version
49
- version: '0'
50
- type: :development
51
- prerelease: false
52
- version_requirements: !ruby/object:Gem::Requirement
53
- requirements:
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- version: '0'
57
- - !ruby/object:Gem::Dependency
58
- name: rspec
59
- requirement: !ruby/object:Gem::Requirement
60
- requirements:
61
- - - ">="
62
- - !ruby/object:Gem::Version
63
- version: '3.4'
64
- type: :development
65
- prerelease: false
66
- version_requirements: !ruby/object:Gem::Requirement
67
- requirements:
68
- - - ">="
69
- - !ruby/object:Gem::Version
70
- version: '3.4'
71
- - !ruby/object:Gem::Dependency
72
- name: rubocop-performance
73
- requirement: !ruby/object:Gem::Requirement
74
- requirements:
75
- - - "~>"
76
- - !ruby/object:Gem::Version
77
- version: '1.7'
78
- type: :development
79
- prerelease: false
80
- version_requirements: !ruby/object:Gem::Requirement
81
- requirements:
82
- - - "~>"
83
- - !ruby/object:Gem::Version
84
- version: '1.7'
85
- - !ruby/object:Gem::Dependency
86
- name: rubocop-rake
87
- requirement: !ruby/object:Gem::Requirement
88
- requirements:
89
- - - "~>"
90
- - !ruby/object:Gem::Version
91
- version: '0.6'
92
- type: :development
93
- prerelease: false
94
- version_requirements: !ruby/object:Gem::Requirement
95
- requirements:
96
- - - "~>"
97
- - !ruby/object:Gem::Version
98
- version: '0.6'
99
- - !ruby/object:Gem::Dependency
100
- name: yard
101
- requirement: !ruby/object:Gem::Requirement
102
- requirements:
103
- - - ">="
104
- - !ruby/object:Gem::Version
105
- version: '0'
106
- type: :development
107
- prerelease: false
108
- version_requirements: !ruby/object:Gem::Requirement
109
- requirements:
110
- - - ">="
111
- - !ruby/object:Gem::Version
112
- version: '0'
28
+ version: '1.33'
113
29
  description: |2
114
30
  Code style checking for RSpec files.
115
31
  A plugin for the RuboCop code style enforcing & linting tool.
@@ -141,9 +57,11 @@ files:
141
57
  - lib/rubocop/cop/rspec/before_after_all.rb
142
58
  - lib/rubocop/cop/rspec/capybara/current_path_expectation.rb
143
59
  - lib/rubocop/cop/rspec/capybara/feature_methods.rb
60
+ - lib/rubocop/cop/rspec/capybara/specific_finders.rb
144
61
  - lib/rubocop/cop/rspec/capybara/specific_matcher.rb
145
62
  - lib/rubocop/cop/rspec/capybara/visibility_matcher.rb
146
63
  - lib/rubocop/cop/rspec/change_by_zero.rb
64
+ - lib/rubocop/cop/rspec/class_check.rb
147
65
  - lib/rubocop/cop/rspec/context_method.rb
148
66
  - lib/rubocop/cop/rspec/context_wording.rb
149
67
  - lib/rubocop/cop/rspec/describe_class.rb
@@ -192,9 +110,11 @@ files:
192
110
  - lib/rubocop/cop/rspec/message_spies.rb
193
111
  - lib/rubocop/cop/rspec/missing_example_group_argument.rb
194
112
  - lib/rubocop/cop/rspec/mixin/comments_help.rb
113
+ - lib/rubocop/cop/rspec/mixin/css_selector.rb
195
114
  - lib/rubocop/cop/rspec/mixin/empty_line_separation.rb
196
115
  - lib/rubocop/cop/rspec/mixin/final_end_location.rb
197
116
  - lib/rubocop/cop/rspec/mixin/inside_example_group.rb
117
+ - lib/rubocop/cop/rspec/mixin/namespace.rb
198
118
  - lib/rubocop/cop/rspec/mixin/top_level_group.rb
199
119
  - lib/rubocop/cop/rspec/mixin/variable.rb
200
120
  - lib/rubocop/cop/rspec/multiple_describes.rb
@@ -203,6 +123,7 @@ files:
203
123
  - lib/rubocop/cop/rspec/multiple_subjects.rb
204
124
  - lib/rubocop/cop/rspec/named_subject.rb
205
125
  - lib/rubocop/cop/rspec/nested_groups.rb
126
+ - lib/rubocop/cop/rspec/no_expectation_example.rb
206
127
  - lib/rubocop/cop/rspec/not_to_not.rb
207
128
  - lib/rubocop/cop/rspec/overwriting_setup.rb
208
129
  - lib/rubocop/cop/rspec/pending.rb
@@ -234,6 +155,7 @@ files:
234
155
  - lib/rubocop/cop/rspec/void_expect.rb
235
156
  - lib/rubocop/cop/rspec/yield.rb
236
157
  - lib/rubocop/cop/rspec_cops.rb
158
+ - lib/rubocop/rspec.rb
237
159
  - lib/rubocop/rspec/align_let_brace.rb
238
160
  - lib/rubocop/rspec/concept.rb
239
161
  - lib/rubocop/rspec/config_formatter.rb