Skip to content

Commit

Permalink
Obsolete StringAsInstanceDoubleConstant in favor of VerifiedDoubleRef…
Browse files Browse the repository at this point in the history
…erence for constants only
  • Loading branch information
corsonknowles committed Nov 16, 2024
1 parent 5d96600 commit 0df39b9
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 719 deletions.
5 changes: 0 additions & 5 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,3 @@ Style/StringChars: {Enabled: true}
Style/SuperWithArgsParentheses: {Enabled: true}
Style/SwapValues: {Enabled: true}
Style/YAMLFileRead: {Enabled: true}

# Enable our own pending cops.
#
RSpec/StringAsInstanceDoubleConstant:
Enabled: true
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Fix `RSpec/VoidExpect` to only operate inside an example block. ([@corsonknowles])
- Change `RSpec/ContextWording` cop to always report an offense when both `Prefixes` and `AllowedPatterns` are empty. ([@ydah])
- Add support for `and` and `or` compound matchers to `RSpec/ChangeByZero` cop. ([@ydah])
- Replace `RSpec/StringAsInstanceDoubleConstant` with `RSpecVerifiedDoubleReference` configured to only support constant class references. ([@corsonknowles])

## 3.1.0 (2024-10-01)

Expand Down
13 changes: 1 addition & 12 deletions config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -930,13 +930,6 @@ RSpec/SpecFilePathSuffix:
- "**/spec/**/*"
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SpecFilePathSuffix

RSpec/StringAsInstanceDoubleConstant:
Description: Do not use a string as `instance_double` constant.
Enabled: pending
Safe: false
VersionAdded: '3.1'
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/StringAsInstanceDoubleConstant

RSpec/StubbedMock:
Description: Checks that message expectations do not have a configured response.
Enabled: true
Expand Down Expand Up @@ -995,12 +988,8 @@ RSpec/VerifiedDoubleReference:
Description: Checks for consistent verified double reference style.
Enabled: true
SafeAutoCorrect: false
EnforcedStyle: constant
SupportedStyles:
- constant
- string
VersionAdded: 2.10.0
VersionChanged: '2.12'
VersionChanged: "<<next>>"
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/VerifiedDoubleReference

RSpec/VerifiedDoubles:
Expand Down
3 changes: 3 additions & 0 deletions config/obsoletion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ extracted:
RSpec/Rails/*: rubocop-rspec_rails
RSpec/FactoryBot/*: rubocop-factory_bot
RSpec/Capybara/*: rubocop-capybara

renamed:
RSpec/StringAsInstanceDoubleConstant: RSpec/VerifiedDoubleReference
1 change: 0 additions & 1 deletion docs/modules/ROOT/pages/cops.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@
* xref:cops_rspec.adoc#rspecsortmetadata[RSpec/SortMetadata]
* xref:cops_rspec.adoc#rspecspecfilepathformat[RSpec/SpecFilePathFormat]
* xref:cops_rspec.adoc#rspecspecfilepathsuffix[RSpec/SpecFilePathSuffix]
* xref:cops_rspec.adoc#rspecstringasinstancedoubleconstant[RSpec/StringAsInstanceDoubleConstant]
* xref:cops_rspec.adoc#rspecstubbedmock[RSpec/StubbedMock]
* xref:cops_rspec.adoc#rspecsubjectdeclaration[RSpec/SubjectDeclaration]
* xref:cops_rspec.adoc#rspecsubjectstub[RSpec/SubjectStub]
Expand Down
Loading

0 comments on commit 0df39b9

Please sign in to comment.