Skip to content
Browse files

Fix and test ENGINE_PATH and ENGINE_ROOT

  • Loading branch information...
1 parent 835c9ce commit 9935c308f14df1eab1e1334dc007bae999dab92f Stefan Sprenger committed May 27, 2011
View
4 railties/lib/rails/generators/rails/plugin_new/templates/script/rails.tt
@@ -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'
View
8 railties/test/generators/plugin_new_generator_test.rb
@@ -177,6 +177,14 @@ def test_creating_gemspec
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/

0 comments on commit 9935c30

Please sign in to comment.
Something went wrong with that request. Please try again.