Skip to content

Commit

Permalink
Merge pull request #26116 from y-yagi/fix_name_error_in_engine_comman…
Browse files Browse the repository at this point in the history
…ds_tasks

add missing require rake
  • Loading branch information
kaspth committed Aug 11, 2016
2 parents 7c279ad + 6fc8b54 commit b9f71e4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions railties/lib/rails/engine/commands_tasks.rb
Expand Up @@ -103,6 +103,8 @@ def parse_command(command)
end

def rake_tasks
require_rake

return @rake_tasks if defined?(@rake_tasks)

load_generators
Expand Down
24 changes: 24 additions & 0 deletions 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

0 comments on commit b9f71e4

Please sign in to comment.