rubocop-rspec_rails 2.28.2 → 2.29.0
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 +4 -4
- data/CHANGELOG.md +8 -0
- data/config/default.yml +2 -0
- data/lib/rubocop/cop/rspec_rails/avoid_setup_hook.rb +1 -1
- data/lib/rubocop/cop/rspec_rails/http_status.rb +1 -1
- data/lib/rubocop/cop/rspec_rails/minitest_assertions.rb +1 -1
- data/lib/rubocop/cop/rspec_rails/negation_be_valid.rb +1 -1
- data/lib/rubocop/cop/rspec_rails/travel_around.rb +1 -1
- data/lib/rubocop/rspec_rails/cop/generator.rb +25 -0
- data/lib/rubocop/rspec_rails/version.rb +1 -1
- data/lib/rubocop-rspec_rails.rb +1 -1
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88073c38340cb9eafefa31af36dfae5c4f4a1c6f6f4ddc7873c58389a5ede117
|
4
|
+
data.tar.gz: 412aaa0cfd9196a500012e48441928cda0031e217abd7a0e48de5a768c2cde59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa95ea79c4d93b75e462d8b5c96ccc6de5e3e932b7f6a66569eac7665ab21fb1110e231de25c5847bc4d866ec7d108b69f40ce09a58f0c7ffd1dcad5d682dcf2
|
7
|
+
data.tar.gz: 412552308209021616e4a03c1745c238d597781a2767fb1061640ea735d075d72d7ea5ff516e2244806904564b0b7ffe7a125e1c22c2e4c524665b44dc15b63e
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
## Master (Unreleased)
|
4
4
|
|
5
|
+
## 2.29.0 (2024-06-08)
|
6
|
+
|
7
|
+
- Support `AutoCorrect: contextual` option for LSP. ([@ydah])
|
8
|
+
|
9
|
+
## 2.28.3 (2024-04-11)
|
10
|
+
|
11
|
+
- Fix an error for Ambiguous cop name `RSpec/Rails/HttpStatus`. ([@ydah])
|
12
|
+
|
5
13
|
## 2.28.2 (2024-03-31)
|
6
14
|
|
7
15
|
- Fix a `NameError` by Cross-Referencing. ([@ydah])
|
data/config/default.yml
CHANGED
@@ -66,6 +66,7 @@ RSpecRails/MinitestAssertions:
|
|
66
66
|
|
67
67
|
RSpecRails/NegationBeValid:
|
68
68
|
Description: Enforces use of `be_invalid` or `not_to` for negated be_valid.
|
69
|
+
AutoCorrect: contextual
|
69
70
|
Safe: false
|
70
71
|
EnforcedStyle: not_to
|
71
72
|
SupportedStyles:
|
@@ -73,6 +74,7 @@ RSpecRails/NegationBeValid:
|
|
73
74
|
- be_invalid
|
74
75
|
Enabled: pending
|
75
76
|
VersionAdded: '2.23'
|
77
|
+
VersionChanged: '2.29'
|
76
78
|
Reference: https://www.rubydoc.info/gems/rubocop-rspec_rails/RuboCop/Cop/RSpecRails/NegationBeValid
|
77
79
|
|
78
80
|
RSpecRails/TravelAround:
|
@@ -57,7 +57,7 @@ module RuboCop
|
|
57
57
|
# it { is_expected.to have_http_status :success }
|
58
58
|
# it { is_expected.to have_http_status :error }
|
59
59
|
#
|
60
|
-
class HttpStatus < ::RuboCop::Cop::
|
60
|
+
class HttpStatus < ::RuboCop::Cop::Base
|
61
61
|
extend AutoCorrector
|
62
62
|
include ConfigurableEnforcedStyle
|
63
63
|
RESTRICT_ON_SEND = %i[have_http_status].freeze
|
@@ -29,7 +29,7 @@ module RuboCop
|
|
29
29
|
# # good (with method chain)
|
30
30
|
# expect(foo).to be_invalid.or be_even
|
31
31
|
#
|
32
|
-
class NegationBeValid < ::RuboCop::Cop::
|
32
|
+
class NegationBeValid < ::RuboCop::Cop::Base
|
33
33
|
extend AutoCorrector
|
34
34
|
include ConfigurableEnforcedStyle
|
35
35
|
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RuboCop
|
4
|
+
module RSpecRails
|
5
|
+
module Cop
|
6
|
+
# Source and spec generator for new cops
|
7
|
+
#
|
8
|
+
# This generator will take a cop name and generate a source file
|
9
|
+
# and spec file when given a valid qualified cop name.
|
10
|
+
# @api private
|
11
|
+
class Generator < RuboCop::Cop::Generator
|
12
|
+
def todo
|
13
|
+
<<~TODO
|
14
|
+
Do 4 steps:
|
15
|
+
1. Modify the description of #{badge} in config/default.yml
|
16
|
+
2. Implement your new cop in the generated file!
|
17
|
+
3. Add an entry about new cop to CHANGELOG.md
|
18
|
+
4. Commit your new cop with a message such as
|
19
|
+
e.g. "Add new `#{badge}` cop"
|
20
|
+
TODO
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/lib/rubocop-rspec_rails.rb
CHANGED
@@ -21,7 +21,7 @@ RuboCop::ConfigLoader.inject_defaults!(project_root)
|
|
21
21
|
# https://github.com/rubocop/rubocop-rspec_rails/issues/8
|
22
22
|
module RuboCop
|
23
23
|
module Cop
|
24
|
-
class
|
24
|
+
class Registry # rubocop:disable Style/Documentation
|
25
25
|
prepend(Module.new do
|
26
26
|
def qualified_cop_name(name, path, warn: true)
|
27
27
|
return super unless name == 'RSpec/Rails/HttpStatus'
|
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-rspec_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.29.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benjamin Quorning
|
8
8
|
- Phil Pirozhkov
|
9
9
|
- Maxim Krizhanovsky
|
10
10
|
- Yudai Takada
|
11
|
-
autorequire:
|
11
|
+
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2024-
|
14
|
+
date: 2024-06-08 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rubocop
|
@@ -30,7 +30,7 @@ dependencies:
|
|
30
30
|
description: |
|
31
31
|
Code style checking for RSpec Rails files.
|
32
32
|
A plugin for the RuboCop code style enforcing & linting tool.
|
33
|
-
email:
|
33
|
+
email:
|
34
34
|
executables: []
|
35
35
|
extensions: []
|
36
36
|
extra_rdoc_files:
|
@@ -52,6 +52,7 @@ files:
|
|
52
52
|
- lib/rubocop/cop/rspec_rails/travel_around.rb
|
53
53
|
- lib/rubocop/cop/rspec_rails_cops.rb
|
54
54
|
- lib/rubocop/rspec_rails/config_formatter.rb
|
55
|
+
- lib/rubocop/rspec_rails/cop/generator.rb
|
55
56
|
- lib/rubocop/rspec_rails/description_extractor.rb
|
56
57
|
- lib/rubocop/rspec_rails/version.rb
|
57
58
|
homepage: https://github.com/rubocop/rubocop-rspec_rails
|
@@ -61,7 +62,7 @@ metadata:
|
|
61
62
|
changelog_uri: https://github.com/rubocop/rubocop-rspec_rails/blob/master/CHANGELOG.md
|
62
63
|
documentation_uri: https://docs.rubocop.org/rubocop-rspec_rails/
|
63
64
|
rubygems_mfa_required: 'true'
|
64
|
-
post_install_message:
|
65
|
+
post_install_message:
|
65
66
|
rdoc_options: []
|
66
67
|
require_paths:
|
67
68
|
- lib
|
@@ -76,8 +77,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
77
|
- !ruby/object:Gem::Version
|
77
78
|
version: '0'
|
78
79
|
requirements: []
|
79
|
-
rubygems_version: 3.5.
|
80
|
-
signing_key:
|
80
|
+
rubygems_version: 3.5.9
|
81
|
+
signing_key:
|
81
82
|
specification_version: 4
|
82
83
|
summary: Code style checking for RSpec Rails files
|
83
84
|
test_files: []
|