diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e8a273e..b1d300e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Master (Unreleased) +- Fix an error for `RSpecRails/HttpStatus`. ([@ydah]) + ## 2.28.1 (2024-03-29) - 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]) diff --git a/Gemfile b/Gemfile index a1e1c2f9..9f03dd86 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,6 @@ gemspec gem 'bump' gem 'danger' -gem 'rack' gem 'rake' gem 'rspec', '~> 3.11' gem 'rubocop-performance', '~> 1.7' @@ -15,7 +14,7 @@ gem 'simplecov', '>= 0.19' gem 'yard' # TODO: Move to gemspec when RuboCop RSpec v3 is released. -gem 'rubocop-rspec', '~> 2.27' +gem 'rubocop-rspec', '~> 2.27.1' local_gemfile = 'Gemfile.local' eval_gemfile(local_gemfile) if File.exist?(local_gemfile) diff --git a/lib/rubocop/cop/rspec_rails_cops.rb b/lib/rubocop/cop/rspec_rails_cops.rb index c436b81d..1a101b34 100644 --- a/lib/rubocop/cop/rspec_rails_cops.rb +++ b/lib/rubocop/cop/rspec_rails_cops.rb @@ -2,12 +2,8 @@ require_relative 'rspec_rails/avoid_setup_hook' require_relative 'rspec_rails/have_http_status' -require_relative 'rspec_rails/negation_be_valid' -begin - require_relative 'rspec_rails/http_status' -rescue LoadError - # RSpecRails/HttpStatus cannot be loaded if rack/utils is unavailable. -end +require_relative 'rspec_rails/http_status' require_relative 'rspec_rails/inferred_spec_type' require_relative 'rspec_rails/minitest_assertions' +require_relative 'rspec_rails/negation_be_valid' require_relative 'rspec_rails/travel_around' diff --git a/rubocop-rspec_rails.gemspec b/rubocop-rspec_rails.gemspec index 10a60dee..33a32795 100644 --- a/rubocop-rspec_rails.gemspec +++ b/rubocop-rspec_rails.gemspec @@ -34,5 +34,6 @@ Gem::Specification.new do |spec| 'rubygems_mfa_required' => 'true' } + spec.add_runtime_dependency 'rack' spec.add_runtime_dependency 'rubocop', '~> 1.40' end