aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/engine/commands_tasks_test.rb
blob: 817175b9efa0ea7095889037adb282b2e180ae79 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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