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

add missing require rake

In ff8035dfee, require rake is deferred.
Therefore, it is necessary to require rake even `Engine::CommandsTasks.
This commit is contained in:
yuuji.yaginuma 2016-08-11 20:24:48 +09:00
parent 5cb6b887d4
commit 6fc8b54621
2 changed files with 26 additions and 0 deletions

View file

@ -103,6 +103,8 @@ In addition to those commands, there are:
end
def rake_tasks
require_rake
return @rake_tasks if defined?(@rake_tasks)
load_generators

View file

@ -0,0 +1,24 @@
require "abstract_unit"
class Rails::Engine::CommandsTasksTest < ActiveSupport::TestCase
def setup
@destination_root = Dir.mktmpdir("bukkits")
Dir.chdir(@destination_root) { `bundle exec rails plugin new bukkits --mountable` }
end
def teardown
FileUtils.rm_rf(@destination_root)
end
def test_help_command_work_inside_engine
output = capture(:stderr) do
Dir.chdir(plugin_path) { `bin/rails --help` }
end
assert_no_match "NameError", output
end
private
def plugin_path
"#{@destination_root}/bukkits"
end
end