提交 e461e1bc 编写于 作者: J José Valim

Ensure application rake tasks and generators are loaded after the ones...

Ensure application rake tasks and generators are loaded after the ones specified in railties/engines/rails. [#4471 state:resolved]
上级 c9132c14
......@@ -112,15 +112,15 @@ def initialize!
def load_tasks
initialize_tasks
super
railties.all { |r| r.load_tasks }
super
self
end
def load_generators
initialize_generators
super
railties.all { |r| r.load_generators }
super
self
end
......
require 'rake/rdoctask'
namespace :doc do
def gem_path(gem_name)
path = $LOAD_PATH.grep(/#{gem_name}[\w.-]*\/lib$/).first
......
require 'rake/testtask'
TEST_CHANGES_SINCE = Time.now - 600
# Look up tests for recently modified sources.
......
require "isolation/abstract_unit"
module ApplicationTests
class RakeTest < Test::Unit::TestCase
include ActiveSupport::Testing::Isolation
def setup
build_app
boot_rails
FileUtils.rm_rf("#{app_path}/config/environments")
end
def test_gems_tasks_are_loaded_first_than_application_ones
app_file "lib/tasks/app.rake", <<-RUBY
$task_loaded = Rake::Task.task_defined?("db:create:all")
RUBY
require "#{app_path}/config/environment"
::Rails.application.load_tasks
assert $task_loaded
end
end
end
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册