提交 4f629ed4 编写于 作者: J Jeremy Kemper

Restore `rake TEST=test/unit/foo_test.rb` support.

Add your own test tasks as dependencies on the `test:run` task instead of `test` itself.

  namespace :test do
    task run: 'test:acceptance'

    Rails::SubTestTask.new acceptance: 'test:prepare' do |t|
      t.libs << 'test'
      t.pattern = 'test/acceptance/**/*_test.rb'
    end
  end
上级 14c89e72
......@@ -83,13 +83,17 @@ end
task :default => :test
desc 'Runs test:units, test:functionals, test:integration together (also available: test:benchmark, test:profile, test:plugins)'
task :test => %w(test:units test:functionals test:integration)
task :test do
Rake::Task[ENV['TEST'] ? 'test:single' : 'test:run'].invoke
end
namespace :test do
task :prepare do
# Placeholder task for other Railtie and plugins to enhance. See Active Record for an example.
end
task :run => %w(test:units test:functionals test:integration)
Rake::TestTask.new(:recent => "test:prepare") do |t|
since = TEST_CHANGES_SINCE
touched = FileList['test/**/*_test.rb'].select { |path| File.mtime(path) > since } +
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册