1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Extract list_tests from Rails::TestUnit::Runner.load_tests

This commit has been made for a future change
for Active Record bin/test to run its own database adapter related tests.
This commit is contained in:
Yasuo Honda 2021-08-30 20:20:00 +09:00
parent 061bf3156f
commit 39b305c0b7

View file

@ -43,10 +43,7 @@ module Rails
end end
def load_tests(argv) def load_tests(argv)
patterns = extract_filters(argv) tests = list_tests(argv)
tests = Rake::FileList[patterns.any? ? patterns : default_test_glob]
tests.exclude(default_test_exclude_glob) if patterns.empty?
tests.to_a.each { |path| require File.expand_path(path) } tests.to_a.each { |path| require File.expand_path(path) }
end end
@ -94,6 +91,14 @@ module Rails
def path_argument?(arg) def path_argument?(arg)
%r"^[/\\]?\w+[/\\]".match?(arg) %r"^[/\\]?\w+[/\\]".match?(arg)
end end
def list_tests(argv)
patterns = extract_filters(argv)
tests = Rake::FileList[patterns.any? ? patterns : default_test_glob]
tests.exclude(default_test_exclude_glob) if patterns.empty?
tests
end
end end
end end