rubocop-rspec 2.14.0 → 2.14.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6fdb82e2eec960744c6f4960acada2a37cb2fb1bc3a1159b2fc444795c11448e
4
- data.tar.gz: 8d5945bf3e9e839b84067fc38c68663b9b43394ee467421b152385cb5d0c111e
3
+ metadata.gz: 740118ee4ac02188e4bc7a4f62e03b31a6dda33ab3017377d954718cb7b356b1
4
+ data.tar.gz: 7f17bb68eb575fb53dd8f0d2662afff8057bde7faeb19b6d94b0c3f1cb62f73d
5
5
  SHA512:
6
- metadata.gz: 320019459649ac0cb26c13496564af8c5c442caaa3a9e2bbee7959954a8ee6fd17cfcd70d0031012197db01e6b32b38b27fe9ab634d0b69a771884753500a244
7
- data.tar.gz: cfa3023ab42ef3ce54160a11d5fcbdd02c6106ef52a631e2fd301b644b9659f0202224f03ac54061fe5135e8905c758b9ae4c790d1d527ff0fb28e020bda046a
6
+ metadata.gz: 18fa9f2be3305f4e6388756e5223ccabdd85e951534f64e881c31a96d77a37f435c06197cd39a7808fb1690f56825ba442386668cfabe4335e784879f57d6ef2
7
+ data.tar.gz: 1dd7abd8c281bb4c7ad6dd41bdb56c2de9be9e322935ae14d820863e7a64e2b39ad5f31e9603a88b77d52fb0ead146bae0c96297b2487831c2e263fe029244ec
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Master (Unreleased)
4
4
 
5
+ ## 2.14.1 (2022-10-24)
6
+
7
+ - Fix an error for `RSpec/Rails/InferredSpecType` with redundant type before other Hash metadata. ([@ydah])
8
+
5
9
  ## 2.14.0 (2022-10-23)
6
10
 
7
11
  - Add `require_implicit` style to `RSpec/ImplicitSubject`. ([@r7kamura])
@@ -16,7 +20,7 @@
16
20
  - Update `config/default.yml` removing deprecated option to make the config correctable by users. ([@ignaciovillaverde])
17
21
  - Do not attempt to auto-correct example groups with `include_examples` in `RSpec/LetBeforeExamples`. ([@pirj])
18
22
  - Add new `RSpec/SortMetadata` cop. ([@leoarnold])
19
- - Add support for subject! method to `RSpec/SubjectDeclaration`. ([@ydah][])
23
+ - Add support for subject! method to `RSpec/SubjectDeclaration`. ([@ydah])
20
24
 
21
25
  ## 2.13.2 (2022-09-23)
22
26
 
@@ -89,11 +89,21 @@ module RuboCop
89
89
  # @param [RuboCop::AST::Corrector] corrector
90
90
  # @param [RuboCop::AST::Node] node
91
91
  def autocorrect(corrector, node)
92
- corrector.remove(
93
- node.location.expression.with(
94
- begin_pos: node.left_sibling.location.expression.end_pos
92
+ corrector.remove(remove_range(node))
93
+ end
94
+
95
+ # @param [RuboCop::AST::Node] node
96
+ # @return [Parser::Source::Range]
97
+ def remove_range(node)
98
+ if node.left_sibling
99
+ node.loc.expression.with(
100
+ begin_pos: node.left_sibling.loc.expression.end_pos
95
101
  )
96
- )
102
+ elsif node.right_sibling
103
+ node.loc.expression.with(
104
+ end_pos: node.right_sibling.loc.expression.begin_pos
105
+ )
106
+ end
97
107
  end
98
108
 
99
109
  # @param [RuboCop::AST::PairNode] node
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module RSpec
5
5
  # Version information for the RSpec RuboCop plugin.
6
6
  module Version
7
- STRING = '2.14.0'
7
+ STRING = '2.14.1'
8
8
  end
9
9
  end
10
10
  end
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.14.0
4
+ version: 2.14.1
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-10-23 00:00:00.000000000 Z
13
+ date: 2022-10-24 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rubocop