rubocop-rspec_rails 2.28.0 → 2.28.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 53524a3483350f80d17572e3e221a777dabb1421999fbbcb37ad30cb182358b1
4
- data.tar.gz: af8ff0697f66b78c197fc34e8dbd207e75a64473075ccb1b65d00650582d80d5
3
+ metadata.gz: 8d6875c71432f95fd0af755bec47d07f7e4bab2dfb5a5e900452c937701b7238
4
+ data.tar.gz: 6aea2975dd7cd16af9dc1e8016a3a541c918b27464e883cbcfc102de0a968b5c
5
5
  SHA512:
6
- metadata.gz: 6b42314769301898bd8723c2c8d5e29eee29cb1952b70e3e4abb892f75e8a13c2129933a3a99de8247510030f208925ab70c5a0a1f1ebaf950595a5c7d540152
7
- data.tar.gz: 9ad058ef82208bb685249e7ed847da8fc4b06b6718033d9153adc6544d28845e91454524531a72f67f25497325876ed140d543e7173b839f72d12044ef37c429
6
+ metadata.gz: 2e579a37fd41b132dc1af257d7b2235aba4e4be5d5a4ff0789a57d93ae4f499991e589acadbd4455ddb7d93423bb09ee07faac5127483a1dfe941a40829164f3
7
+ data.tar.gz: 3284eaf43b60448e2048db7374ccb97a54258a4c646fe951d4f9e57af453ff928bbe34719e9fb78d35d91d93c3aab3b5ccd77e2292b260a22277ea38af1aa484
data/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  ## Master (Unreleased)
4
4
 
5
+ ## 2.28.2 (2024-03-31)
6
+
7
+ - Fix a `NameError` by Cross-Referencing. ([@ydah])
8
+ - Fix an error for `RSpecRails/HttpStatus` when no rack gem is loaded with rubocop-rspec. ([@ydah])
9
+ - Fix an error for unrecognized cop or department `RSpecRails/HttpStatus` when also using rubocop-rails. ([@ydah])
10
+
11
+ ## 2.28.1 (2024-03-29)
12
+
13
+ - Implicit dependency on RuboCop RSpec. Note that if you use rubocop-rspec_rails, you must also explicitly add rubocop-rspec to the Gemfile, because you are changing to an implicit dependency on RuboCop RSpec. ([@ydah])
14
+
5
15
  ## 2.28.0 (2024-03-28)
6
16
 
7
17
  - Extracted from `rubocop-rspec` into a separate repository. ([@ydah])
data/README.md CHANGED
@@ -9,15 +9,17 @@
9
9
 
10
10
  ## Installation
11
11
 
12
- Just install the `rubocop-rspec_rails` gem
12
+ **This gem implicitly depends on the `rubocop-rspec` gem, so you should install it first.**
13
+ Just install the `rubocop-rspec` and `rubocop-rspec_rails` gem
13
14
 
14
15
  ```bash
15
- gem install rubocop-rspec_rails
16
+ gem install rubocop-rspec rubocop-rspec_rails
16
17
  ```
17
18
 
18
19
  or if you use bundler put this in your `Gemfile`
19
20
 
20
21
  ```ruby
22
+ gem 'rubocop-rspec', require: false
21
23
  gem 'rubocop-rspec_rails', require: false
22
24
  ```
23
25
 
@@ -1,6 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'rack/utils'
3
+ begin
4
+ require 'rack/utils'
5
+ rescue LoadError
6
+ # RSpecRails/HttpStatus cannot be loaded if rack/utils is unavailable.
7
+ end
4
8
 
5
9
  module RuboCop
6
10
  module Cop
@@ -64,6 +68,8 @@ module RuboCop
64
68
  PATTERN
65
69
 
66
70
  def on_send(node)
71
+ return unless defined?(::Rack::Utils::SYMBOL_TO_STATUS_CODE)
72
+
67
73
  http_status(node) do |arg|
68
74
  return if arg.str_type? && arg.heredoc?
69
75
 
@@ -2,12 +2,8 @@
2
2
 
3
3
  require_relative 'rspec_rails/avoid_setup_hook'
4
4
  require_relative 'rspec_rails/have_http_status'
5
- require_relative 'rspec_rails/negation_be_valid'
6
- begin
7
- require_relative 'rspec_rails/http_status'
8
- rescue LoadError
9
- # RSpecRails/HttpStatus cannot be loaded if rack/utils is unavailable.
10
- end
5
+ require_relative 'rspec_rails/http_status'
11
6
  require_relative 'rspec_rails/inferred_spec_type'
12
7
  require_relative 'rspec_rails/minitest_assertions'
8
+ require_relative 'rspec_rails/negation_be_valid'
13
9
  require_relative 'rspec_rails/travel_around'
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module RSpecRails
5
5
  # Version information for the RSpec Rails RuboCop plugin.
6
6
  module Version
7
- STRING = '2.28.0'
7
+ STRING = '2.28.2'
8
8
  end
9
9
  end
10
10
  end
@@ -4,11 +4,32 @@ require 'pathname'
4
4
  require 'yaml'
5
5
 
6
6
  require 'rubocop'
7
- require 'rubocop-rspec'
7
+
8
+ require 'rubocop/rspec/language/node_pattern'
9
+
10
+ require 'rubocop/rspec/language'
8
11
 
9
12
  require_relative 'rubocop/rspec_rails/version'
10
13
 
14
+ require 'rubocop/cop/rspec/base'
11
15
  require_relative 'rubocop/cop/rspec_rails_cops'
12
16
 
13
17
  project_root = File.join(__dir__, '..')
14
18
  RuboCop::ConfigLoader.inject_defaults!(project_root)
19
+
20
+ # FIXME: This is a workaround for the following issue:
21
+ # https://github.com/rubocop/rubocop-rspec_rails/issues/8
22
+ module RuboCop
23
+ module Cop
24
+ class AmbiguousCopName # rubocop:disable Style/Documentation
25
+ prepend(Module.new do
26
+ def qualified_cop_name(name, path, warn: true)
27
+ return super unless name == 'RSpec/Rails/HttpStatus'
28
+
29
+ badge = Badge.parse(name)
30
+ resolve_badge(badge, qualify_badge(badge).first, path)
31
+ end
32
+ end)
33
+ end
34
+ end
35
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-rspec_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.28.0
4
+ version: 2.28.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Quorning
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2024-03-28 00:00:00.000000000 Z
14
+ date: 2024-03-30 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rubocop
@@ -27,20 +27,6 @@ dependencies:
27
27
  - - "~>"
28
28
  - !ruby/object:Gem::Version
29
29
  version: '1.40'
30
- - !ruby/object:Gem::Dependency
31
- name: rubocop-rspec
32
- requirement: !ruby/object:Gem::Requirement
33
- requirements:
34
- - - "~>"
35
- - !ruby/object:Gem::Version
36
- version: '2.27'
37
- type: :runtime
38
- prerelease: false
39
- version_requirements: !ruby/object:Gem::Requirement
40
- requirements:
41
- - - "~>"
42
- - !ruby/object:Gem::Version
43
- version: '2.27'
44
30
  description: |
45
31
  Code style checking for RSpec Rails files.
46
32
  A plugin for the RuboCop code style enforcing & linting tool.
@@ -90,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
76
  - !ruby/object:Gem::Version
91
77
  version: '0'
92
78
  requirements: []
93
- rubygems_version: 3.5.3
79
+ rubygems_version: 3.5.7
94
80
  signing_key:
95
81
  specification_version: 4
96
82
  summary: Code style checking for RSpec Rails files