Skip to content

Commit eca02bb

Browse files
committed
fixup! Let RSpec/SpecFilePathFormat leverage ActiveSupport inflections when defined and configured
1 parent eb1a6b4 commit eca02bb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

spec/rubocop/cop/rspec/spec_file_path_format_spec.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,8 @@ def reset_activesupport_cache!
311311

312312
allow(described_class::ActiveSupportInflector).to receive(:require)
313313
.with('active_support/inflector')
314-
stub_const('ActiveSupport::Inflector', Module.new)
314+
stub_const('ActiveSupport::Inflector',
315+
Module.new { def self.underscore(_); end })
315316

316317
allow(described_class::ActiveSupportInflector).to receive(:require)
317318
.with('./config/initializers/inflections.rb')
@@ -395,7 +396,8 @@ def reset_activesupport_cache!
395396

396397
allow(described_class::ActiveSupportInflector).to receive(:require)
397398
.with('active_support/inflector')
398-
stub_const('ActiveSupport::Inflector', Module.new)
399+
stub_const('ActiveSupport::Inflector',
400+
Module.new { def self.underscore(_); end })
399401

400402
allow(described_class::ActiveSupportInflector).to receive(:require)
401403
.with(cop_config['InflectorPath'])

0 commit comments

Comments
 (0)