Skip to content

Commit

Permalink
Fix an error when using RSpec/FilePath and revert to enabled by def…
Browse files Browse the repository at this point in the history
…ault
  • Loading branch information
ydah committed Sep 12, 2023
1 parent b99bf78 commit 6ccfe5d
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

## Master (Unreleased)

- Fix an error when using `RSpec/FilePath` and revert to enabled by default. If you have already migrated `RSpec/SpecFilePathSuffix` and `RSpec/SpecFilePathFormat`, no problem. The `RSpec/FilePath` before migration and the `RSpec/SpecFilePathSuffix` and `RSpec/SpecFilePathFormat` at the destination are available respectively. ([@ydah])

## 2.24.0 (2023-09-08)

- Split `RSpec/FilePath` into `RSpec/SpecFilePathSuffix` and `RSpec/SpecFilePathFormat`. `RSpec/FilePath` cop is enabled by default, the two new cops are pending and need to be enabled explicitly. ([@ydah])
- **(Breaking)** Split `RSpec/FilePath` into `RSpec/SpecFilePathSuffix` and `RSpec/SpecFilePathFormat`. `RSpec/FilePath` cop is disabled by default and the two new cops are pending and need to be enabled explicitly. ([@ydah])
- Add new `RSpec/Eq` cop. ([@ydah])
- Add `RSpec/MetadataStyle` and `RSpec/EmptyMetadata` cops. ([@r7kamura])
- Add support `RSpec/Rails/HttpStatus` when `have_http_status` with string argument. ([@ydah])
Expand Down
2 changes: 1 addition & 1 deletion config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ RSpec/ExpectOutput:

RSpec/FilePath:
Description: Checks that spec file paths are consistent and well-formed.
Enabled: false
Enabled: true
Include:
- "**/*_spec*rb*"
- "**/spec/**/*"
Expand Down
6 changes: 0 additions & 6 deletions config/obsoletion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,3 @@ renamed:
RSpec/FactoryBot/FactoryClassName: FactoryBot/FactoryClassName
RSpec/FactoryBot/FactoryNameStyle: FactoryBot/FactoryNameStyle
RSpec/FactoryBot/SyntaxMethods: FactoryBot/SyntaxMethods

split:
RSpec/FilePath:
alternatives:
- RSpec/SpecFilePathFormat
- RSpec/SpecFilePathSuffix
8 changes: 7 additions & 1 deletion docs/modules/ROOT/pages/cops_rspec.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2003,7 +2003,7 @@ expect { my_app.print_report }.to output('Hello World').to_stdout
|===
| Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed

| Disabled
| Enabled
| Yes
| No
| 1.2
Expand All @@ -2012,6 +2012,12 @@ expect { my_app.print_report }.to output('Hello World').to_stdout

Checks that spec file paths are consistent and well-formed.

This cop is deprecated.
We plan to remove it in the next major version update to 3.0.
The migration destinations are `RSpec/SpecFilePathSuffix`
and `RSpec/SpecFilePathFormat`.
If you are using this cop, please plan for migration.

By default, this checks that spec file paths are consistent with the
test subject and enforces that it reflects the described
class/module and its optionally called out method.
Expand Down
6 changes: 6 additions & 0 deletions lib/rubocop/cop/rspec/file_path.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ module Cop
module RSpec
# Checks that spec file paths are consistent and well-formed.
#
# This cop is deprecated.
# We plan to remove it in the next major version update to 3.0.
# The migration destinations are `RSpec/SpecFilePathSuffix`
# and `RSpec/SpecFilePathFormat`.
# If you are using this cop, please plan for migration.
#
# By default, this checks that spec file paths are consistent with the
# test subject and enforces that it reflects the described
# class/module and its optionally called out method.
Expand Down

0 comments on commit 6ccfe5d

Please sign in to comment.