From 61da528c59ac6781bc4328f00f6d67573b880dc7 Mon Sep 17 00:00:00 2001 From: Dani Donisa Date: Mon, 23 Sep 2024 17:23:26 +0200 Subject: [PATCH] Fix Rails/RootPathnameMethods cop --- spec/rails_helper.rb | 2 +- spec/support/sphinx_helpers.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 619fe4fe..7f947e9d 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -21,7 +21,7 @@ # run twice. It is recommended that you do not name files matching this glob to # end with _spec.rb. You can configure this pattern with the --pattern # option on the command line or in ~/.rspec, .rspec or `.rspec-local`. -Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f } +Rails.root.glob('spec/support/**/*.rb').each { |f| require f } # Checks for pending migrations before tests are run. # If you are not using ActiveRecord, you can remove this line. diff --git a/spec/support/sphinx_helpers.rb b/spec/support/sphinx_helpers.rb index 55cc4c2b..92f08cdd 100644 --- a/spec/support/sphinx_helpers.rb +++ b/spec/support/sphinx_helpers.rb @@ -6,6 +6,6 @@ def index end def index_finished? - Dir[Rails.root.join(ThinkingSphinx::Test.config.indices_location, '*.{new,tmp}*')].empty? + Rails.root.glob("#{ThinkingSphinx::Test.config.indices_location}/*.{new,tmp}*").empty? end end