Skip to content

Commit 8311033

Browse files
committed
Fix a NameError by Cross-Referencing
``` ❯ bundle exec rspec An error occurred while loading spec_helper. Failure/Error: require 'rubocop-rspec' NameError: uninitialized constant RuboCop::Cop::RSpecRails # ./lib/rubocop-rspec_rails.rb:7:in `<top (required)>' # ./spec/spec_helper.rb:53:in `<top (required)>' No examples found. No examples found. ```
1 parent b141576 commit 8311033

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Master (Unreleased)
44

5+
- Fix a `NameError` by Cross-Referencing. ([@ydah])
6+
57
## 2.28.1 (2024-03-29)
68

79
- 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])

lib/rubocop-rspec_rails.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@
44
require 'yaml'
55

66
require 'rubocop'
7-
require 'rubocop-rspec'
7+
8+
require 'rubocop/rspec/language/node_pattern'
9+
10+
require 'rubocop/rspec/language'
811

912
require_relative 'rubocop/rspec_rails/version'
1013

14+
require 'rubocop/cop/rspec/base'
1115
require_relative 'rubocop/cop/rspec_rails_cops'
1216

1317
project_root = File.join(__dir__, '..')

spec/spec_helper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,5 @@ module SpecHelper
5050

5151
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
5252

53+
require 'rubocop-rspec'
5354
require 'rubocop-rspec_rails'

0 commit comments

Comments
 (0)