summaryrefslogtreecommitdiff
path: root/spec/support/helpers/require_migration.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/helpers/require_migration.rb')
-rw-r--r--spec/support/helpers/require_migration.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/support/helpers/require_migration.rb b/spec/support/helpers/require_migration.rb
index 8de71d3073f..de3a8a81ab5 100644
--- a/spec/support/helpers/require_migration.rb
+++ b/spec/support/helpers/require_migration.rb
@@ -15,7 +15,7 @@ class RequireMigration
end
MIGRATION_FOLDERS = %w[db/migrate db/post_migrate].freeze
- SPEC_FILE_PATTERN = /.+\/(?<file_name>.+)_spec\.rb/.freeze
+ SPEC_FILE_PATTERN = %r{.+/(?<file_name>.+)_spec\.rb}.freeze
class << self
def require_migration!(file_name)
@@ -29,7 +29,7 @@ class RequireMigration
migration_folders.flat_map do |path|
migration_path = Rails.root.join(path).to_s
- Find.find(migration_path).grep(/\d+_#{file_name}\.rb/)
+ Find.find(migration_path).select { |m| File.basename(m).match? /\A\d+_#{file_name}\.rb\z/ }
end
end