rubocop-rspec 1.35.0 → 1.36.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/config/default.yml +11 -0
- data/lib/rubocop/cop/rspec/capybara/current_path_expectation.rb +16 -0
- data/lib/rubocop/cop/rspec/context_method.rb +53 -0
- data/lib/rubocop/cop/rspec/describe_class.rb +7 -10
- data/lib/rubocop/cop/rspec/described_class.rb +29 -1
- data/lib/rubocop/cop/rspec/empty_line_after_example.rb +87 -0
- data/lib/rubocop/cop/rspec/example_wording.rb +28 -12
- data/lib/rubocop/cop/rspec/expect_change.rb +8 -8
- data/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb +2 -9
- data/lib/rubocop/cop/rspec/focus.rb +5 -10
- data/lib/rubocop/cop/rspec/instance_variable.rb +2 -1
- data/lib/rubocop/cop/rspec/multiple_expectations.rb +13 -21
- data/lib/rubocop/cop/rspec/pending.rb +19 -25
- data/lib/rubocop/cop/rspec_cops.rb +2 -0
- data/lib/rubocop/rspec/version.rb +1 -1
- metadata +7 -198
- data/Gemfile +0 -11
- data/Rakefile +0 -87
- data/rubocop-rspec.gemspec +0 -49
- data/spec/project/changelog_spec.rb +0 -76
- data/spec/project/default_config_spec.rb +0 -76
- data/spec/project/project_requires_spec.rb +0 -20
- data/spec/rubocop/cop/rspec/align_left_let_brace_spec.rb +0 -51
- data/spec/rubocop/cop/rspec/align_right_let_brace_spec.rb +0 -51
- data/spec/rubocop/cop/rspec/any_instance_spec.rb +0 -32
- data/spec/rubocop/cop/rspec/around_block_spec.rb +0 -121
- data/spec/rubocop/cop/rspec/be_eql_spec.rb +0 -81
- data/spec/rubocop/cop/rspec/be_spec.rb +0 -35
- data/spec/rubocop/cop/rspec/before_after_all_spec.rb +0 -52
- data/spec/rubocop/cop/rspec/capybara/current_path_expectation_spec.rb +0 -65
- data/spec/rubocop/cop/rspec/capybara/feature_methods_spec.rb +0 -130
- data/spec/rubocop/cop/rspec/context_wording_spec.rb +0 -94
- data/spec/rubocop/cop/rspec/cop_spec.rb +0 -95
- data/spec/rubocop/cop/rspec/describe_class_spec.rb +0 -168
- data/spec/rubocop/cop/rspec/describe_method_spec.rb +0 -34
- data/spec/rubocop/cop/rspec/describe_symbol_spec.rb +0 -44
- data/spec/rubocop/cop/rspec/described_class_spec.rb +0 -352
- data/spec/rubocop/cop/rspec/dialect_spec.rb +0 -78
- data/spec/rubocop/cop/rspec/empty_example_group_spec.rb +0 -93
- data/spec/rubocop/cop/rspec/empty_line_after_example_group_spec.rb +0 -121
- data/spec/rubocop/cop/rspec/empty_line_after_final_let_spec.rb +0 -239
- data/spec/rubocop/cop/rspec/empty_line_after_hook_spec.rb +0 -133
- data/spec/rubocop/cop/rspec/empty_line_after_subject_spec.rb +0 -94
- data/spec/rubocop/cop/rspec/example_length_spec.rb +0 -78
- data/spec/rubocop/cop/rspec/example_without_description_spec.rb +0 -92
- data/spec/rubocop/cop/rspec/example_wording_spec.rb +0 -173
- data/spec/rubocop/cop/rspec/expect_actual_spec.rb +0 -150
- data/spec/rubocop/cop/rspec/expect_change_spec.rb +0 -86
- data/spec/rubocop/cop/rspec/expect_in_hook_spec.rb +0 -79
- data/spec/rubocop/cop/rspec/expect_output_spec.rb +0 -62
- data/spec/rubocop/cop/rspec/factory_bot/attribute_defined_statically_spec.rb +0 -208
- data/spec/rubocop/cop/rspec/factory_bot/create_list_spec.rb +0 -171
- data/spec/rubocop/cop/rspec/file_path_spec.rb +0 -200
- data/spec/rubocop/cop/rspec/focus_spec.rb +0 -139
- data/spec/rubocop/cop/rspec/hook_argument_spec.rb +0 -173
- data/spec/rubocop/cop/rspec/hooks_before_examples_spec.rb +0 -150
- data/spec/rubocop/cop/rspec/implicit_block_expectation_spec.rb +0 -135
- data/spec/rubocop/cop/rspec/implicit_expect_spec.rb +0 -102
- data/spec/rubocop/cop/rspec/implicit_subject_spec.rb +0 -188
- data/spec/rubocop/cop/rspec/instance_spy_spec.rb +0 -61
- data/spec/rubocop/cop/rspec/instance_variable_spec.rb +0 -95
- data/spec/rubocop/cop/rspec/invalid_predicate_matcher_spec.rb +0 -39
- data/spec/rubocop/cop/rspec/it_behaves_like_spec.rb +0 -47
- data/spec/rubocop/cop/rspec/iterated_expectation_spec.rb +0 -82
- data/spec/rubocop/cop/rspec/leading_subject_spec.rb +0 -119
- data/spec/rubocop/cop/rspec/leaky_constant_declaration_spec.rb +0 -91
- data/spec/rubocop/cop/rspec/let_before_examples_spec.rb +0 -137
- data/spec/rubocop/cop/rspec/let_setup_spec.rb +0 -66
- data/spec/rubocop/cop/rspec/message_chain_spec.rb +0 -23
- data/spec/rubocop/cop/rspec/message_expectation_spec.rb +0 -45
- data/spec/rubocop/cop/rspec/message_spies_spec.rb +0 -151
- data/spec/rubocop/cop/rspec/missing_example_group_argument_spec.rb +0 -57
- data/spec/rubocop/cop/rspec/multiple_describes_spec.rb +0 -30
- data/spec/rubocop/cop/rspec/multiple_expectations_spec.rb +0 -261
- data/spec/rubocop/cop/rspec/multiple_subjects_spec.rb +0 -83
- data/spec/rubocop/cop/rspec/named_subject_spec.rb +0 -123
- data/spec/rubocop/cop/rspec/nested_groups_spec.rb +0 -81
- data/spec/rubocop/cop/rspec/not_to_not_spec.rb +0 -77
- data/spec/rubocop/cop/rspec/overwriting_setup_spec.rb +0 -91
- data/spec/rubocop/cop/rspec/pending_spec.rb +0 -186
- data/spec/rubocop/cop/rspec/predicate_matcher_spec.rb +0 -354
- data/spec/rubocop/cop/rspec/rails/http_status_spec.rb +0 -90
- data/spec/rubocop/cop/rspec/receive_counts_spec.rb +0 -138
- data/spec/rubocop/cop/rspec/receive_never_spec.rb +0 -57
- data/spec/rubocop/cop/rspec/repeated_description_spec.rb +0 -76
- data/spec/rubocop/cop/rspec/repeated_example_spec.rb +0 -74
- data/spec/rubocop/cop/rspec/return_from_stub_spec.rb +0 -289
- data/spec/rubocop/cop/rspec/scattered_let_spec.rb +0 -28
- data/spec/rubocop/cop/rspec/scattered_setup_spec.rb +0 -98
- data/spec/rubocop/cop/rspec/shared_context_spec.rb +0 -137
- data/spec/rubocop/cop/rspec/shared_examples_spec.rb +0 -75
- data/spec/rubocop/cop/rspec/single_argument_message_chain_spec.rb +0 -178
- data/spec/rubocop/cop/rspec/subject_stub_spec.rb +0 -293
- data/spec/rubocop/cop/rspec/unspecified_exception_spec.rb +0 -177
- data/spec/rubocop/cop/rspec/verified_doubles_spec.rb +0 -86
- data/spec/rubocop/cop/rspec/void_expect_spec.rb +0 -49
- data/spec/rubocop/cop/rspec/yield_spec.rb +0 -81
- data/spec/rubocop/rspec/config_formatter_spec.rb +0 -52
- data/spec/rubocop/rspec/description_extractor_spec.rb +0 -63
- data/spec/rubocop/rspec/example_group_spec.rb +0 -44
- data/spec/rubocop/rspec/example_spec.rb +0 -62
- data/spec/rubocop/rspec/hook_spec.rb +0 -53
- data/spec/rubocop/rspec/language/selector_set_spec.rb +0 -53
- data/spec/rubocop/rspec/util/one_spec.rb +0 -23
- data/spec/rubocop/rspec/wording_spec.rb +0 -52
- data/spec/shared/autocorrect_behavior.rb +0 -9
- data/spec/shared/detects_style_behavior.rb +0 -9
- data/spec/shared/smoke_test_examples.rb +0 -27
- data/spec/smoke_tests/empty_spec.rb +0 -0
- data/spec/smoke_tests/factory_bot_spec.rb +0 -11
- data/spec/smoke_tests/no_tests_spec.rb +0 -4
- data/spec/smoke_tests/weird_rspec_spec.rb +0 -233
- data/spec/spec_helper.rb +0 -42
- data/spec/support/expect_offense.rb +0 -19
@@ -47,7 +47,8 @@ module RuboCop
|
|
47
47
|
# end
|
48
48
|
#
|
49
49
|
class InstanceVariable < Cop
|
50
|
-
MSG = '
|
50
|
+
MSG = 'Avoid instance variables – use let, ' \
|
51
|
+
'a method call, or a local variable (if possible).'
|
51
52
|
|
52
53
|
EXAMPLE_GROUP_METHODS = ExampleGroups::ALL + SharedGroups::ALL
|
53
54
|
|
@@ -50,14 +50,23 @@ module RuboCop
|
|
50
50
|
|
51
51
|
MSG = 'Example has too many expectations [%<total>d/%<max>d].'
|
52
52
|
|
53
|
-
|
54
|
-
|
55
|
-
|
53
|
+
def_node_matcher :aggregate_failures?, <<-PATTERN
|
54
|
+
(block {
|
55
|
+
(send _ _ <(sym :aggregate_failures) ...>)
|
56
|
+
(send _ _ ... (hash <(pair (sym :aggregate_failures) true) ...>))
|
57
|
+
} ...)
|
58
|
+
PATTERN
|
59
|
+
|
60
|
+
def_node_matcher :aggregate_failures_present?, <<-PATTERN
|
61
|
+
(block {
|
62
|
+
(send _ _ <(sym :aggregate_failures) ...>)
|
63
|
+
(send _ _ ... (hash <(pair (sym :aggregate_failures) _) ...>))
|
64
|
+
} ...)
|
56
65
|
PATTERN
|
57
66
|
|
58
67
|
def_node_matcher :expect?, Expectations::ALL.send_pattern
|
59
68
|
def_node_matcher :aggregate_failures_block?, <<-PATTERN
|
60
|
-
(block (send
|
69
|
+
(block (send nil? :aggregate_failures ...) ...)
|
61
70
|
PATTERN
|
62
71
|
|
63
72
|
def on_block(node)
|
@@ -88,23 +97,6 @@ module RuboCop
|
|
88
97
|
.find { |block_node| aggregate_failures_present?(block_node) }
|
89
98
|
end
|
90
99
|
|
91
|
-
def aggregate_failures_present?(node)
|
92
|
-
metadata(node)&.any?(&method(:with_aggregate_failures?))
|
93
|
-
end
|
94
|
-
|
95
|
-
def aggregate_failures?(example_or_group_node)
|
96
|
-
metadata(example_or_group_node)&.any? do |metadata|
|
97
|
-
with_aggregate_failures?(metadata) &&
|
98
|
-
!disabled_aggregate_failures?(metadata)
|
99
|
-
end
|
100
|
-
end
|
101
|
-
|
102
|
-
def metadata(example_or_group_node)
|
103
|
-
RuboCop::RSpec::Example
|
104
|
-
.new(example_or_group_node)
|
105
|
-
.metadata
|
106
|
-
end
|
107
|
-
|
108
100
|
def find_expectation(node, &block)
|
109
101
|
yield if expect?(node) || aggregate_failures_block?(node)
|
110
102
|
|
@@ -12,6 +12,12 @@ module RuboCop
|
|
12
12
|
# end
|
13
13
|
#
|
14
14
|
# describe MyClass do
|
15
|
+
# it "should be true", skip: true do
|
16
|
+
# expect(1).to eq(2)
|
17
|
+
# end
|
18
|
+
# end
|
19
|
+
#
|
20
|
+
# describe MyClass do
|
15
21
|
# it "should be true" do
|
16
22
|
# pending
|
17
23
|
# end
|
@@ -28,43 +34,31 @@ module RuboCop
|
|
28
34
|
class Pending < Cop
|
29
35
|
MSG = 'Pending spec found.'
|
30
36
|
|
31
|
-
|
32
|
-
|
33
|
-
SKIPPABLE_EXAMPLES = ExampleGroups::GROUPS + Examples::EXAMPLES
|
34
|
-
SKIPPABLE_SELECTORS = SKIPPABLE_EXAMPLES.node_pattern_union
|
37
|
+
PENDING = Examples::PENDING + Examples::SKIPPED + ExampleGroups::SKIPPED
|
38
|
+
SKIPPABLE = ExampleGroups::GROUPS + Examples::EXAMPLES
|
35
39
|
|
36
|
-
|
37
|
-
PENDING_SYMBOL = s(:sym, :pending)
|
40
|
+
def_node_matcher :skippable?, SKIPPABLE.send_pattern
|
38
41
|
|
39
|
-
def_node_matcher :
|
40
|
-
{
|
41
|
-
|
42
|
+
def_node_matcher :skipped_in_metadata?, <<-PATTERN
|
43
|
+
{
|
44
|
+
(send _ _ <#skip_or_pending? ...>)
|
45
|
+
(send _ _ ... (hash <(pair #skip_or_pending? true) ...>))
|
46
|
+
}
|
42
47
|
PATTERN
|
43
48
|
|
44
|
-
def_node_matcher :
|
49
|
+
def_node_matcher :skip_or_pending?, '{(sym :skip) (sym :pending)}'
|
50
|
+
def_node_matcher :pending_block?, PENDING.send_pattern
|
45
51
|
|
46
52
|
def on_send(node)
|
47
|
-
return unless pending_block?(node) ||
|
53
|
+
return unless pending_block?(node) || skipped?(node)
|
48
54
|
|
49
55
|
add_offense(node)
|
50
56
|
end
|
51
57
|
|
52
58
|
private
|
53
59
|
|
54
|
-
def
|
55
|
-
(
|
56
|
-
end
|
57
|
-
|
58
|
-
def skip_node?(node)
|
59
|
-
if node.respond_to?(:key)
|
60
|
-
skip_symbol?(node.key) && node.value.truthy_literal?
|
61
|
-
else
|
62
|
-
skip_symbol?(node)
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
def skip_symbol?(symbol_node)
|
67
|
-
[SKIP_SYMBOL, PENDING_SYMBOL].include?(symbol_node)
|
60
|
+
def skipped?(node)
|
61
|
+
skippable?(node) && skipped_in_metadata?(node)
|
68
62
|
end
|
69
63
|
end
|
70
64
|
end
|
@@ -19,6 +19,7 @@ require_relative 'rspec/around_block'
|
|
19
19
|
require_relative 'rspec/be'
|
20
20
|
require_relative 'rspec/be_eql'
|
21
21
|
require_relative 'rspec/before_after_all'
|
22
|
+
require_relative 'rspec/context_method'
|
22
23
|
require_relative 'rspec/context_wording'
|
23
24
|
require_relative 'rspec/describe_class'
|
24
25
|
require_relative 'rspec/describe_method'
|
@@ -26,6 +27,7 @@ require_relative 'rspec/describe_symbol'
|
|
26
27
|
require_relative 'rspec/described_class'
|
27
28
|
require_relative 'rspec/dialect'
|
28
29
|
require_relative 'rspec/empty_example_group'
|
30
|
+
require_relative 'rspec/empty_line_after_example'
|
29
31
|
require_relative 'rspec/empty_line_after_example_group'
|
30
32
|
require_relative 'rspec/empty_line_after_final_let'
|
31
33
|
require_relative 'rspec/empty_line_after_hook'
|
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: 1.
|
4
|
+
version: 1.36.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: 2019-
|
13
|
+
date: 2019-09-27 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rubocop
|
@@ -18,14 +18,14 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ">="
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.
|
21
|
+
version: 0.68.1
|
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: 0.
|
28
|
+
version: 0.68.1
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: rack
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
@@ -110,10 +110,8 @@ extra_rdoc_files:
|
|
110
110
|
- README.md
|
111
111
|
files:
|
112
112
|
- CHANGELOG.md
|
113
|
-
- Gemfile
|
114
113
|
- MIT-LICENSE.md
|
115
114
|
- README.md
|
116
|
-
- Rakefile
|
117
115
|
- config/default.yml
|
118
116
|
- lib/rubocop-rspec.rb
|
119
117
|
- lib/rubocop/cop/rspec/align_left_let_brace.rb
|
@@ -125,6 +123,7 @@ files:
|
|
125
123
|
- lib/rubocop/cop/rspec/before_after_all.rb
|
126
124
|
- lib/rubocop/cop/rspec/capybara/current_path_expectation.rb
|
127
125
|
- lib/rubocop/cop/rspec/capybara/feature_methods.rb
|
126
|
+
- lib/rubocop/cop/rspec/context_method.rb
|
128
127
|
- lib/rubocop/cop/rspec/context_wording.rb
|
129
128
|
- lib/rubocop/cop/rspec/cop.rb
|
130
129
|
- lib/rubocop/cop/rspec/describe_class.rb
|
@@ -133,6 +132,7 @@ files:
|
|
133
132
|
- lib/rubocop/cop/rspec/described_class.rb
|
134
133
|
- lib/rubocop/cop/rspec/dialect.rb
|
135
134
|
- lib/rubocop/cop/rspec/empty_example_group.rb
|
135
|
+
- lib/rubocop/cop/rspec/empty_line_after_example.rb
|
136
136
|
- lib/rubocop/cop/rspec/empty_line_after_example_group.rb
|
137
137
|
- lib/rubocop/cop/rspec/empty_line_after_final_let.rb
|
138
138
|
- lib/rubocop/cop/rspec/empty_line_after_hook.rb
|
@@ -211,102 +211,6 @@ files:
|
|
211
211
|
- lib/rubocop/rspec/util.rb
|
212
212
|
- lib/rubocop/rspec/version.rb
|
213
213
|
- lib/rubocop/rspec/wording.rb
|
214
|
-
- rubocop-rspec.gemspec
|
215
|
-
- spec/project/changelog_spec.rb
|
216
|
-
- spec/project/default_config_spec.rb
|
217
|
-
- spec/project/project_requires_spec.rb
|
218
|
-
- spec/rubocop/cop/rspec/align_left_let_brace_spec.rb
|
219
|
-
- spec/rubocop/cop/rspec/align_right_let_brace_spec.rb
|
220
|
-
- spec/rubocop/cop/rspec/any_instance_spec.rb
|
221
|
-
- spec/rubocop/cop/rspec/around_block_spec.rb
|
222
|
-
- spec/rubocop/cop/rspec/be_eql_spec.rb
|
223
|
-
- spec/rubocop/cop/rspec/be_spec.rb
|
224
|
-
- spec/rubocop/cop/rspec/before_after_all_spec.rb
|
225
|
-
- spec/rubocop/cop/rspec/capybara/current_path_expectation_spec.rb
|
226
|
-
- spec/rubocop/cop/rspec/capybara/feature_methods_spec.rb
|
227
|
-
- spec/rubocop/cop/rspec/context_wording_spec.rb
|
228
|
-
- spec/rubocop/cop/rspec/cop_spec.rb
|
229
|
-
- spec/rubocop/cop/rspec/describe_class_spec.rb
|
230
|
-
- spec/rubocop/cop/rspec/describe_method_spec.rb
|
231
|
-
- spec/rubocop/cop/rspec/describe_symbol_spec.rb
|
232
|
-
- spec/rubocop/cop/rspec/described_class_spec.rb
|
233
|
-
- spec/rubocop/cop/rspec/dialect_spec.rb
|
234
|
-
- spec/rubocop/cop/rspec/empty_example_group_spec.rb
|
235
|
-
- spec/rubocop/cop/rspec/empty_line_after_example_group_spec.rb
|
236
|
-
- spec/rubocop/cop/rspec/empty_line_after_final_let_spec.rb
|
237
|
-
- spec/rubocop/cop/rspec/empty_line_after_hook_spec.rb
|
238
|
-
- spec/rubocop/cop/rspec/empty_line_after_subject_spec.rb
|
239
|
-
- spec/rubocop/cop/rspec/example_length_spec.rb
|
240
|
-
- spec/rubocop/cop/rspec/example_without_description_spec.rb
|
241
|
-
- spec/rubocop/cop/rspec/example_wording_spec.rb
|
242
|
-
- spec/rubocop/cop/rspec/expect_actual_spec.rb
|
243
|
-
- spec/rubocop/cop/rspec/expect_change_spec.rb
|
244
|
-
- spec/rubocop/cop/rspec/expect_in_hook_spec.rb
|
245
|
-
- spec/rubocop/cop/rspec/expect_output_spec.rb
|
246
|
-
- spec/rubocop/cop/rspec/factory_bot/attribute_defined_statically_spec.rb
|
247
|
-
- spec/rubocop/cop/rspec/factory_bot/create_list_spec.rb
|
248
|
-
- spec/rubocop/cop/rspec/file_path_spec.rb
|
249
|
-
- spec/rubocop/cop/rspec/focus_spec.rb
|
250
|
-
- spec/rubocop/cop/rspec/hook_argument_spec.rb
|
251
|
-
- spec/rubocop/cop/rspec/hooks_before_examples_spec.rb
|
252
|
-
- spec/rubocop/cop/rspec/implicit_block_expectation_spec.rb
|
253
|
-
- spec/rubocop/cop/rspec/implicit_expect_spec.rb
|
254
|
-
- spec/rubocop/cop/rspec/implicit_subject_spec.rb
|
255
|
-
- spec/rubocop/cop/rspec/instance_spy_spec.rb
|
256
|
-
- spec/rubocop/cop/rspec/instance_variable_spec.rb
|
257
|
-
- spec/rubocop/cop/rspec/invalid_predicate_matcher_spec.rb
|
258
|
-
- spec/rubocop/cop/rspec/it_behaves_like_spec.rb
|
259
|
-
- spec/rubocop/cop/rspec/iterated_expectation_spec.rb
|
260
|
-
- spec/rubocop/cop/rspec/leading_subject_spec.rb
|
261
|
-
- spec/rubocop/cop/rspec/leaky_constant_declaration_spec.rb
|
262
|
-
- spec/rubocop/cop/rspec/let_before_examples_spec.rb
|
263
|
-
- spec/rubocop/cop/rspec/let_setup_spec.rb
|
264
|
-
- spec/rubocop/cop/rspec/message_chain_spec.rb
|
265
|
-
- spec/rubocop/cop/rspec/message_expectation_spec.rb
|
266
|
-
- spec/rubocop/cop/rspec/message_spies_spec.rb
|
267
|
-
- spec/rubocop/cop/rspec/missing_example_group_argument_spec.rb
|
268
|
-
- spec/rubocop/cop/rspec/multiple_describes_spec.rb
|
269
|
-
- spec/rubocop/cop/rspec/multiple_expectations_spec.rb
|
270
|
-
- spec/rubocop/cop/rspec/multiple_subjects_spec.rb
|
271
|
-
- spec/rubocop/cop/rspec/named_subject_spec.rb
|
272
|
-
- spec/rubocop/cop/rspec/nested_groups_spec.rb
|
273
|
-
- spec/rubocop/cop/rspec/not_to_not_spec.rb
|
274
|
-
- spec/rubocop/cop/rspec/overwriting_setup_spec.rb
|
275
|
-
- spec/rubocop/cop/rspec/pending_spec.rb
|
276
|
-
- spec/rubocop/cop/rspec/predicate_matcher_spec.rb
|
277
|
-
- spec/rubocop/cop/rspec/rails/http_status_spec.rb
|
278
|
-
- spec/rubocop/cop/rspec/receive_counts_spec.rb
|
279
|
-
- spec/rubocop/cop/rspec/receive_never_spec.rb
|
280
|
-
- spec/rubocop/cop/rspec/repeated_description_spec.rb
|
281
|
-
- spec/rubocop/cop/rspec/repeated_example_spec.rb
|
282
|
-
- spec/rubocop/cop/rspec/return_from_stub_spec.rb
|
283
|
-
- spec/rubocop/cop/rspec/scattered_let_spec.rb
|
284
|
-
- spec/rubocop/cop/rspec/scattered_setup_spec.rb
|
285
|
-
- spec/rubocop/cop/rspec/shared_context_spec.rb
|
286
|
-
- spec/rubocop/cop/rspec/shared_examples_spec.rb
|
287
|
-
- spec/rubocop/cop/rspec/single_argument_message_chain_spec.rb
|
288
|
-
- spec/rubocop/cop/rspec/subject_stub_spec.rb
|
289
|
-
- spec/rubocop/cop/rspec/unspecified_exception_spec.rb
|
290
|
-
- spec/rubocop/cop/rspec/verified_doubles_spec.rb
|
291
|
-
- spec/rubocop/cop/rspec/void_expect_spec.rb
|
292
|
-
- spec/rubocop/cop/rspec/yield_spec.rb
|
293
|
-
- spec/rubocop/rspec/config_formatter_spec.rb
|
294
|
-
- spec/rubocop/rspec/description_extractor_spec.rb
|
295
|
-
- spec/rubocop/rspec/example_group_spec.rb
|
296
|
-
- spec/rubocop/rspec/example_spec.rb
|
297
|
-
- spec/rubocop/rspec/hook_spec.rb
|
298
|
-
- spec/rubocop/rspec/language/selector_set_spec.rb
|
299
|
-
- spec/rubocop/rspec/util/one_spec.rb
|
300
|
-
- spec/rubocop/rspec/wording_spec.rb
|
301
|
-
- spec/shared/autocorrect_behavior.rb
|
302
|
-
- spec/shared/detects_style_behavior.rb
|
303
|
-
- spec/shared/smoke_test_examples.rb
|
304
|
-
- spec/smoke_tests/empty_spec.rb
|
305
|
-
- spec/smoke_tests/factory_bot_spec.rb
|
306
|
-
- spec/smoke_tests/no_tests_spec.rb
|
307
|
-
- spec/smoke_tests/weird_rspec_spec.rb
|
308
|
-
- spec/spec_helper.rb
|
309
|
-
- spec/support/expect_offense.rb
|
310
214
|
homepage: https://github.com/rubocop-hq/rubocop-rspec
|
311
215
|
licenses:
|
312
216
|
- MIT
|
@@ -332,99 +236,4 @@ rubygems_version: 3.0.3
|
|
332
236
|
signing_key:
|
333
237
|
specification_version: 4
|
334
238
|
summary: Code style checking for RSpec files
|
335
|
-
test_files:
|
336
|
-
- spec/project/changelog_spec.rb
|
337
|
-
- spec/project/default_config_spec.rb
|
338
|
-
- spec/project/project_requires_spec.rb
|
339
|
-
- spec/rubocop/cop/rspec/align_left_let_brace_spec.rb
|
340
|
-
- spec/rubocop/cop/rspec/align_right_let_brace_spec.rb
|
341
|
-
- spec/rubocop/cop/rspec/any_instance_spec.rb
|
342
|
-
- spec/rubocop/cop/rspec/around_block_spec.rb
|
343
|
-
- spec/rubocop/cop/rspec/be_eql_spec.rb
|
344
|
-
- spec/rubocop/cop/rspec/be_spec.rb
|
345
|
-
- spec/rubocop/cop/rspec/before_after_all_spec.rb
|
346
|
-
- spec/rubocop/cop/rspec/capybara/current_path_expectation_spec.rb
|
347
|
-
- spec/rubocop/cop/rspec/capybara/feature_methods_spec.rb
|
348
|
-
- spec/rubocop/cop/rspec/context_wording_spec.rb
|
349
|
-
- spec/rubocop/cop/rspec/cop_spec.rb
|
350
|
-
- spec/rubocop/cop/rspec/describe_class_spec.rb
|
351
|
-
- spec/rubocop/cop/rspec/describe_method_spec.rb
|
352
|
-
- spec/rubocop/cop/rspec/describe_symbol_spec.rb
|
353
|
-
- spec/rubocop/cop/rspec/described_class_spec.rb
|
354
|
-
- spec/rubocop/cop/rspec/dialect_spec.rb
|
355
|
-
- spec/rubocop/cop/rspec/empty_example_group_spec.rb
|
356
|
-
- spec/rubocop/cop/rspec/empty_line_after_example_group_spec.rb
|
357
|
-
- spec/rubocop/cop/rspec/empty_line_after_final_let_spec.rb
|
358
|
-
- spec/rubocop/cop/rspec/empty_line_after_hook_spec.rb
|
359
|
-
- spec/rubocop/cop/rspec/empty_line_after_subject_spec.rb
|
360
|
-
- spec/rubocop/cop/rspec/example_length_spec.rb
|
361
|
-
- spec/rubocop/cop/rspec/example_without_description_spec.rb
|
362
|
-
- spec/rubocop/cop/rspec/example_wording_spec.rb
|
363
|
-
- spec/rubocop/cop/rspec/expect_actual_spec.rb
|
364
|
-
- spec/rubocop/cop/rspec/expect_change_spec.rb
|
365
|
-
- spec/rubocop/cop/rspec/expect_in_hook_spec.rb
|
366
|
-
- spec/rubocop/cop/rspec/expect_output_spec.rb
|
367
|
-
- spec/rubocop/cop/rspec/factory_bot/attribute_defined_statically_spec.rb
|
368
|
-
- spec/rubocop/cop/rspec/factory_bot/create_list_spec.rb
|
369
|
-
- spec/rubocop/cop/rspec/file_path_spec.rb
|
370
|
-
- spec/rubocop/cop/rspec/focus_spec.rb
|
371
|
-
- spec/rubocop/cop/rspec/hook_argument_spec.rb
|
372
|
-
- spec/rubocop/cop/rspec/hooks_before_examples_spec.rb
|
373
|
-
- spec/rubocop/cop/rspec/implicit_block_expectation_spec.rb
|
374
|
-
- spec/rubocop/cop/rspec/implicit_expect_spec.rb
|
375
|
-
- spec/rubocop/cop/rspec/implicit_subject_spec.rb
|
376
|
-
- spec/rubocop/cop/rspec/instance_spy_spec.rb
|
377
|
-
- spec/rubocop/cop/rspec/instance_variable_spec.rb
|
378
|
-
- spec/rubocop/cop/rspec/invalid_predicate_matcher_spec.rb
|
379
|
-
- spec/rubocop/cop/rspec/it_behaves_like_spec.rb
|
380
|
-
- spec/rubocop/cop/rspec/iterated_expectation_spec.rb
|
381
|
-
- spec/rubocop/cop/rspec/leading_subject_spec.rb
|
382
|
-
- spec/rubocop/cop/rspec/leaky_constant_declaration_spec.rb
|
383
|
-
- spec/rubocop/cop/rspec/let_before_examples_spec.rb
|
384
|
-
- spec/rubocop/cop/rspec/let_setup_spec.rb
|
385
|
-
- spec/rubocop/cop/rspec/message_chain_spec.rb
|
386
|
-
- spec/rubocop/cop/rspec/message_expectation_spec.rb
|
387
|
-
- spec/rubocop/cop/rspec/message_spies_spec.rb
|
388
|
-
- spec/rubocop/cop/rspec/missing_example_group_argument_spec.rb
|
389
|
-
- spec/rubocop/cop/rspec/multiple_describes_spec.rb
|
390
|
-
- spec/rubocop/cop/rspec/multiple_expectations_spec.rb
|
391
|
-
- spec/rubocop/cop/rspec/multiple_subjects_spec.rb
|
392
|
-
- spec/rubocop/cop/rspec/named_subject_spec.rb
|
393
|
-
- spec/rubocop/cop/rspec/nested_groups_spec.rb
|
394
|
-
- spec/rubocop/cop/rspec/not_to_not_spec.rb
|
395
|
-
- spec/rubocop/cop/rspec/overwriting_setup_spec.rb
|
396
|
-
- spec/rubocop/cop/rspec/pending_spec.rb
|
397
|
-
- spec/rubocop/cop/rspec/predicate_matcher_spec.rb
|
398
|
-
- spec/rubocop/cop/rspec/rails/http_status_spec.rb
|
399
|
-
- spec/rubocop/cop/rspec/receive_counts_spec.rb
|
400
|
-
- spec/rubocop/cop/rspec/receive_never_spec.rb
|
401
|
-
- spec/rubocop/cop/rspec/repeated_description_spec.rb
|
402
|
-
- spec/rubocop/cop/rspec/repeated_example_spec.rb
|
403
|
-
- spec/rubocop/cop/rspec/return_from_stub_spec.rb
|
404
|
-
- spec/rubocop/cop/rspec/scattered_let_spec.rb
|
405
|
-
- spec/rubocop/cop/rspec/scattered_setup_spec.rb
|
406
|
-
- spec/rubocop/cop/rspec/shared_context_spec.rb
|
407
|
-
- spec/rubocop/cop/rspec/shared_examples_spec.rb
|
408
|
-
- spec/rubocop/cop/rspec/single_argument_message_chain_spec.rb
|
409
|
-
- spec/rubocop/cop/rspec/subject_stub_spec.rb
|
410
|
-
- spec/rubocop/cop/rspec/unspecified_exception_spec.rb
|
411
|
-
- spec/rubocop/cop/rspec/verified_doubles_spec.rb
|
412
|
-
- spec/rubocop/cop/rspec/void_expect_spec.rb
|
413
|
-
- spec/rubocop/cop/rspec/yield_spec.rb
|
414
|
-
- spec/rubocop/rspec/config_formatter_spec.rb
|
415
|
-
- spec/rubocop/rspec/description_extractor_spec.rb
|
416
|
-
- spec/rubocop/rspec/example_group_spec.rb
|
417
|
-
- spec/rubocop/rspec/example_spec.rb
|
418
|
-
- spec/rubocop/rspec/hook_spec.rb
|
419
|
-
- spec/rubocop/rspec/language/selector_set_spec.rb
|
420
|
-
- spec/rubocop/rspec/util/one_spec.rb
|
421
|
-
- spec/rubocop/rspec/wording_spec.rb
|
422
|
-
- spec/shared/autocorrect_behavior.rb
|
423
|
-
- spec/shared/detects_style_behavior.rb
|
424
|
-
- spec/shared/smoke_test_examples.rb
|
425
|
-
- spec/smoke_tests/empty_spec.rb
|
426
|
-
- spec/smoke_tests/factory_bot_spec.rb
|
427
|
-
- spec/smoke_tests/no_tests_spec.rb
|
428
|
-
- spec/smoke_tests/weird_rspec_spec.rb
|
429
|
-
- spec/spec_helper.rb
|
430
|
-
- spec/support/expect_offense.rb
|
239
|
+
test_files: []
|
data/Gemfile
DELETED
data/Rakefile
DELETED
@@ -1,87 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'open3'
|
4
|
-
|
5
|
-
require 'bundler'
|
6
|
-
require 'bundler/gem_tasks'
|
7
|
-
|
8
|
-
begin
|
9
|
-
Bundler.setup(:default, :development)
|
10
|
-
rescue Bundler::BundlerError => e
|
11
|
-
warn e.message
|
12
|
-
warn 'Run `bundle install` to install missing gems'
|
13
|
-
exit e.status_code
|
14
|
-
end
|
15
|
-
|
16
|
-
require 'rspec/core/rake_task'
|
17
|
-
|
18
|
-
Dir['tasks/**/*.rake'].each { |t| load t }
|
19
|
-
|
20
|
-
RSpec::Core::RakeTask.new(:spec) do |spec|
|
21
|
-
spec.pattern = FileList['spec/**/*_spec.rb']
|
22
|
-
end
|
23
|
-
|
24
|
-
desc 'Run RSpec with code coverage'
|
25
|
-
task :coverage do
|
26
|
-
ENV['COVERAGE'] = 'true'
|
27
|
-
Rake::Task['spec'].execute
|
28
|
-
end
|
29
|
-
|
30
|
-
desc 'Run RuboCop over this gem'
|
31
|
-
task :internal_investigation do
|
32
|
-
sh('bundle exec rubocop --require rubocop-rspec')
|
33
|
-
end
|
34
|
-
|
35
|
-
desc 'Build config/default.yml'
|
36
|
-
task :build_config do
|
37
|
-
sh('bin/build_config')
|
38
|
-
end
|
39
|
-
|
40
|
-
desc 'Confirm config/default.yml is up to date'
|
41
|
-
task confirm_config: :build_config do
|
42
|
-
_, stdout, _, process =
|
43
|
-
Open3.popen3('git diff --exit-code config/default.yml')
|
44
|
-
|
45
|
-
unless process.value.success?
|
46
|
-
raise "default.yml is out of sync:\n\n#{stdout.read}\nRun bin/build_config"
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
desc 'Confirm documentation is up to date'
|
51
|
-
task confirm_documentation: :generate_cops_documentation do
|
52
|
-
_, _, _, process =
|
53
|
-
Open3.popen3('git diff --exit-code manual/')
|
54
|
-
|
55
|
-
unless process.value.success?
|
56
|
-
raise 'Please run `rake generate_cops_documentation` ' \
|
57
|
-
'and add manual/ to the commit.'
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
task default: %i[build_config coverage
|
62
|
-
internal_investigation
|
63
|
-
confirm_config
|
64
|
-
documentation_syntax_check
|
65
|
-
confirm_documentation]
|
66
|
-
|
67
|
-
desc 'Generate a new cop template'
|
68
|
-
task :new_cop, [:cop] do |_task, args|
|
69
|
-
require 'rubocop'
|
70
|
-
|
71
|
-
cop_name = args.fetch(:cop) do
|
72
|
-
warn 'usage: bundle exec rake new_cop[Department/Name]'
|
73
|
-
exit!
|
74
|
-
end
|
75
|
-
|
76
|
-
github_user = `git config github.user`.chop
|
77
|
-
github_user = 'your_id' if github_user.empty?
|
78
|
-
|
79
|
-
generator = RuboCop::Cop::Generator.new(cop_name, github_user)
|
80
|
-
|
81
|
-
generator.write_source
|
82
|
-
generator.write_spec
|
83
|
-
generator.inject_require(root_file_path: 'lib/rubocop/cop/rspec_cops.rb')
|
84
|
-
generator.inject_config(config_file_path: 'config/default.yml')
|
85
|
-
|
86
|
-
puts generator.todo
|
87
|
-
end
|