mirror of https://github.com/rails/rails
Don't run the adapter tests when a test selection is made
If `bin/test file_to_test.rb` is called, we should not be running all the test for that adapter, only the test file we selected.
This commit is contained in:
parent
3efe5e21b8
commit
90f4b3d96e
|
@ -11,11 +11,13 @@ require "active_support"
|
|||
require "active_support/test_case"
|
||||
|
||||
require "rake/testtask"
|
||||
|
||||
Rails::TestUnit::Runner.singleton_class.prepend Module.new {
|
||||
private
|
||||
def list_tests(argv)
|
||||
def list_tests(patterns)
|
||||
tests = super
|
||||
tests.concat FileList["test/cases/adapters/#{adapter_name}/**/*_test.rb"]
|
||||
tests.concat FileList["test/cases/adapters/#{adapter_name}/**/*_test.rb"] if patterns.empty?
|
||||
tests
|
||||
end
|
||||
|
||||
def default_test_exclude_glob
|
||||
|
|
|
@ -45,7 +45,8 @@ module Rails
|
|||
end
|
||||
|
||||
def load_tests(argv)
|
||||
tests = list_tests(argv)
|
||||
patterns = extract_filters(argv)
|
||||
tests = list_tests(patterns)
|
||||
tests.to_a.each { |path| require File.expand_path(path) }
|
||||
end
|
||||
|
||||
|
@ -96,9 +97,7 @@ module Rails
|
|||
PATH_ARGUMENT_PATTERN.match?(arg)
|
||||
end
|
||||
|
||||
def list_tests(argv)
|
||||
patterns = extract_filters(argv)
|
||||
|
||||
def list_tests(patterns)
|
||||
tests = Rake::FileList[patterns.any? ? patterns : default_test_glob]
|
||||
tests.exclude(default_test_exclude_glob) if patterns.empty?
|
||||
tests
|
||||
|
|
Loading…
Reference in New Issue