mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix and test ENGINE_PATH and ENGINE_ROOT
This commit is contained in:
parent
835c9cee3e
commit
9935c308f1
2 changed files with 10 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
|||
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
||||
|
||||
ENGINE_ROOT = File.expand_path('../..', __FILE__)
|
||||
ENGINE_PATH = File.expand_path('../../lib/<%= name -%>/engine', __FILE__)
|
||||
ENGINE_ROOT = File.expand_path('../..', __FILE__)
|
||||
ENGINE_PATH = File.expand_path('../../lib/<%= name -%>/engine', __FILE__)
|
||||
|
||||
require 'rails/all'
|
||||
require 'rails/engine/commands'
|
||||
|
|
|
@ -177,6 +177,14 @@ class PluginNewGeneratorTest < Rails::Generators::TestCase
|
|||
assert_file "bukkits.gemspec", /s.version = "0.0.1"/
|
||||
end
|
||||
|
||||
def test_usage_of_engine_commands
|
||||
run_generator
|
||||
assert_file "script/rails", /ENGINE_PATH = File.expand_path\('..\/..\/lib\/bukkits\/engine', __FILE__\)/
|
||||
assert_file "script/rails", /ENGINE_ROOT = File.expand_path\('..\/..', __FILE__\)/
|
||||
assert_file "script/rails", /require 'rails\/all'/
|
||||
assert_file "script/rails", /require 'rails\/engine\/commands/
|
||||
end
|
||||
|
||||
def test_shebang
|
||||
run_generator
|
||||
assert_file "script/rails", /#!\/usr\/bin\/env ruby/
|
||||
|
|
Loading…
Reference in a new issue