aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/test_unit/test_requirer.rb
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2017-07-10 21:13:22 +0200
committerGitHub <noreply@github.com>2017-07-10 21:13:22 +0200
commit3fa66935fd65e2d834dcc743bd835afb5b875f7f (patch)
tree361e00c0c82de24f359bbe5ba32b76d9913c609e /railties/lib/rails/test_unit/test_requirer.rb
parentb6300f3ecc79bff29cf9bb804a30fd92403feac1 (diff)
parent0d72489b2a08487f71dd4230846c01a5d99ef35f (diff)
downloadrails-3fa66935fd65e2d834dcc743bd835afb5b875f7f.tar.gz
rails-3fa66935fd65e2d834dcc743bd835afb5b875f7f.tar.bz2
rails-3fa66935fd65e2d834dcc743bd835afb5b875f7f.zip
Merge pull request #29572 from kaspth/test-runner-no-eager-require
Don't eagerly require Rails' minitest plugin.
Diffstat (limited to 'railties/lib/rails/test_unit/test_requirer.rb')
-rw-r--r--railties/lib/rails/test_unit/test_requirer.rb31
1 files changed, 0 insertions, 31 deletions
diff --git a/railties/lib/rails/test_unit/test_requirer.rb b/railties/lib/rails/test_unit/test_requirer.rb
deleted file mode 100644
index 92e5fcf0bc..0000000000
--- a/railties/lib/rails/test_unit/test_requirer.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-require "active_support/core_ext/object/blank"
-require "rake/file_list"
-
-module Rails
- class TestRequirer # :nodoc:
- class << self
- def require_files(patterns, exclude_patterns = [])
- patterns = expand_patterns(patterns)
-
- file_list = Rake::FileList[patterns.compact.presence || "test/**/*_test.rb"]
- file_list.exclude(exclude_patterns)
-
- file_list.to_a.each do |file|
- require File.expand_path(file)
- end
- end
-
- private
- def expand_patterns(patterns)
- patterns.map do |arg|
- arg = arg.gsub(/(:\d+)+?$/, "")
- if Dir.exist?(arg)
- "#{arg}/**/*_test.rb"
- else
- arg
- end
- end
- end
- end
- end
-end