Skip to content

Commit 39b305c

Browse files
committed
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.
1 parent 061bf31 commit 39b305c

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

railties/lib/rails/test_unit/runner.rb

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,7 @@ def run(argv = [])
4343
end
4444

4545
def load_tests(argv)
46-
patterns = extract_filters(argv)
47-
48-
tests = Rake::FileList[patterns.any? ? patterns : default_test_glob]
49-
tests.exclude(default_test_exclude_glob) if patterns.empty?
46+
tests = list_tests(argv)
5047
tests.to_a.each { |path| require File.expand_path(path) }
5148
end
5249

@@ -94,6 +91,14 @@ def regexp_filter?(arg)
9491
def path_argument?(arg)
9592
%r"^[/\\]?\w+[/\\]".match?(arg)
9693
end
94+
95+
def list_tests(argv)
96+
patterns = extract_filters(argv)
97+
98+
tests = Rake::FileList[patterns.any? ? patterns : default_test_glob]
99+
tests.exclude(default_test_exclude_glob) if patterns.empty?
100+
tests
101+
end
97102
end
98103
end
99104

0 commit comments

Comments
 (0)