diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2016-08-11 15:22:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-11 15:22:46 +0200 |
commit | b9f71e49ae43c53258da95bda50325a8d0c99a52 (patch) | |
tree | 8675ffdd1899712c502f36934ebb7bb6e0230ab0 | |
parent | 7c279ad696e1154b2f2dbef26ba0ff0a42aa105a (diff) | |
parent | 6fc8b54621f67bc618885752626937a84785bbd6 (diff) | |
download | rails-b9f71e49ae43c53258da95bda50325a8d0c99a52.tar.gz rails-b9f71e49ae43c53258da95bda50325a8d0c99a52.tar.bz2 rails-b9f71e49ae43c53258da95bda50325a8d0c99a52.zip |
Merge pull request #26116 from y-yagi/fix_name_error_in_engine_commands_tasks
add missing require rake
-rw-r--r-- | railties/lib/rails/engine/commands_tasks.rb | 2 | ||||
-rw-r--r-- | railties/test/engine/commands_tasks_test.rb | 24 |
2 files changed, 26 insertions, 0 deletions
diff --git a/railties/lib/rails/engine/commands_tasks.rb b/railties/lib/rails/engine/commands_tasks.rb index ac0861328b..e21a7183fc 100644 --- a/railties/lib/rails/engine/commands_tasks.rb +++ b/railties/lib/rails/engine/commands_tasks.rb @@ -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 diff --git a/railties/test/engine/commands_tasks_test.rb b/railties/test/engine/commands_tasks_test.rb new file mode 100644 index 0000000000..817175b9ef --- /dev/null +++ b/railties/test/engine/commands_tasks_test.rb @@ -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 |