File tree 4 files changed +28
-2
lines changed
4 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ If you have created a new cop:
15
15
16
16
* [ ] Added the new cop to ` config/default.yml ` .
17
17
* [ ] The cop is configured as ` Enabled: pending ` in ` config/default.yml ` .
18
+ * [ ] The cop is configured as ` Enabled: true ` in ` .rubocop.yml ` .
18
19
* [ ] The cop documents examples of good and bad code.
19
20
* [ ] The tests assert both that bad code is reported and that good code is not reported.
20
21
* [ ] Set ` VersionAdded ` in ` default/config.yml ` to the next minor version.
Original file line number Diff line number Diff line change @@ -84,3 +84,26 @@ RSpec/DescribeClass:
84
84
Style/FormatStringToken :
85
85
Exclude :
86
86
- spec/rubocop/**/*.rb
87
+
88
+ # Enable our own pending cops.
89
+
90
+ RSpec/BeEq :
91
+ Enabled : true
92
+ RSpec/BeNil :
93
+ Enabled : true
94
+ RSpec/ChangeByZero :
95
+ Enabled : true
96
+ RSpec/ExcessiveDocstringSpacing :
97
+ Enabled : true
98
+ RSpec/IdenticalEqualityAssertion :
99
+ Enabled : true
100
+ RSpec/SubjectDeclaration :
101
+ Enabled : true
102
+ RSpec/VerifiedDoubleReference :
103
+ Enabled : true
104
+ RSpec/Capybara/SpecificMatcher :
105
+ Enabled : true
106
+ RSpec/FactoryBot/SyntaxMethods :
107
+ Enabled : true
108
+ RSpec/Rails/AvoidSetupHook :
109
+ Enabled : true
Original file line number Diff line number Diff line change 1
1
# frozen_string_literal: true
2
2
3
3
RSpec . describe RuboCop ::Cop ::RSpec ::ScatteredLet do
4
- it 'flags `let` after the first different node ' do
4
+ it 'flags `let` after the first different node' do
5
5
expect_offense ( <<-RUBY )
6
6
RSpec.describe User do
7
7
let(:a) { a }
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ def example(source)
39
39
end
40
40
41
41
it 'returns nil for examples without doc strings' do
42
- expect ( example ( 'it { foo }' ) . doc_string ) . to be ( nil )
42
+ expect ( example ( 'it { foo }' ) . doc_string ) . to be_nil
43
43
end
44
44
45
45
it 'extracts keywords' do
@@ -58,12 +58,14 @@ def example(source)
58
58
end
59
59
60
60
describe 'value object semantics' do
61
+ # rubocop:disable RSpec/IdenticalEqualityAssertion
61
62
it 'compares by value' do
62
63
aggregate_failures 'equality semantics' do
63
64
expect ( example ( 'it("foo")' ) ) . to eq ( example ( 'it("foo")' ) )
64
65
expect ( example ( 'it("foo")' ) ) . not_to eq ( example ( 'it("bar")' ) )
65
66
end
66
67
end
68
+ # rubocop:enable RSpec/IdenticalEqualityAssertion
67
69
68
70
it 'can be used as a key in a hash' do
69
71
hash = { }
You can’t perform that action at this time.
0 commit comments