Permalink
Browse files

Generate script/rails only if --full is given

  • Loading branch information...
1 parent 5f00592 commit e38d3752c377b400aea1d0b854bebf3734664cd7 Stefan Sprenger committed May 27, 2011
@@ -126,6 +126,8 @@ def javascripts
end
def script(force = false)
+ return unless full?
+
directory "script", :force => force do |content|
"#{shebang}\n" + content
end
@@ -12,7 +12,6 @@
lib
lib/bukkits.rb
lib/tasks/bukkits_tasks.rake
- script/rails
test/bukkits_test.rb
test/test_helper.rb
test/dummy
@@ -150,6 +149,7 @@ def test_creating_engine_in_full_mode
assert_file "config/routes.rb", /Rails.application.routes.draw do/
assert_file "lib/bukkits/engine.rb", /module Bukkits\n class Engine < ::Rails::Engine\n end\nend/
assert_file "lib/bukkits.rb", /require "bukkits\/engine"/
+ assert_file "script/rails"
end
def test_being_quiet_while_creating_dummy_application
@@ -178,15 +178,15 @@ def test_creating_gemspec
end
def test_usage_of_engine_commands
- run_generator
+ run_generator [destination_root, "--full"]
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
+ run_generator [destination_root, "--full"]
assert_file "script/rails", /#!\/usr\/bin\/env ruby/
end
@@ -67,12 +67,12 @@ def test_name_raises_an_error_if_name_already_used_constant
end
def test_shebang_is_added_to_rails_file
- run_generator [destination_root, "--ruby", "foo/bar/baz"]
+ run_generator [destination_root, "--ruby", "foo/bar/baz", "--full"]
assert_file "script/rails", /#!foo\/bar\/baz/
end
def test_shebang_when_is_the_same_as_default_use_env
- run_generator [destination_root, "--ruby", Thor::Util.ruby_command]
+ run_generator [destination_root, "--ruby", Thor::Util.ruby_command, "--full"]
assert_file "script/rails", /#!\/usr\/bin\/env/
end

0 comments on commit e38d375

Please sign in to comment.