aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2013-01-06 16:13:47 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2013-01-06 21:41:36 -0700
commit009873aec89a4b843b41accf616b42b7a9917ba8 (patch)
tree3f1500ea344dbd9606627fd47c633e71af52ea8f /railties/test/generators
parent19b52d3f81080d8eacb78c94bd5957ef7c637d07 (diff)
downloadrails-009873aec89a4b843b41accf616b42b7a9917ba8.tar.gz
rails-009873aec89a4b843b41accf616b42b7a9917ba8.tar.bz2
rails-009873aec89a4b843b41accf616b42b7a9917ba8.zip
Introduce ./bin for your app's executables: bin/bundle, bin/rails, bin/rake. Executable scripts are versioned code like the rest of your app. To generate a stub for a bundled gem: 'bundle binstubs unicorn' and 'git add bin/unicorn'
Diffstat (limited to 'railties/test/generators')
-rw-r--r--railties/test/generators/actions_test.rb2
-rw-r--r--railties/test/generators/app_generator_test.rb4
-rw-r--r--railties/test/generators/plugin_new_generator_test.rb12
-rw-r--r--railties/test/generators/shared_generator_tests.rb4
4 files changed, 12 insertions, 10 deletions
diff --git a/railties/test/generators/actions_test.rb b/railties/test/generators/actions_test.rb
index 54734ed260..c9e9f33d4e 100644
--- a/railties/test/generators/actions_test.rb
+++ b/railties/test/generators/actions_test.rb
@@ -151,7 +151,7 @@ class ActionsTest < Rails::Generators::TestCase
end
def test_generate_should_run_script_generate_with_argument_and_options
- generator.expects(:run_ruby_script).once.with('script/rails generate model MyModel', verbose: false)
+ generator.expects(:run_ruby_script).once.with('bin/rails generate model MyModel', verbose: false)
action :generate, 'model', 'MyModel'
end
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb
index 945cb61bc1..1750149abc 100644
--- a/railties/test/generators/app_generator_test.rb
+++ b/railties/test/generators/app_generator_test.rb
@@ -17,6 +17,9 @@ DEFAULT_APP_FILES = %w(
app/models
app/models/concerns
app/views/layouts
+ bin/bundle
+ bin/rails
+ bin/rake
config/environments
config/initializers
config/locales
@@ -26,7 +29,6 @@ DEFAULT_APP_FILES = %w(
lib/tasks
lib/assets
log
- script/rails
test/fixtures
test/controllers
test/models
diff --git a/railties/test/generators/plugin_new_generator_test.rb b/railties/test/generators/plugin_new_generator_test.rb
index ab78800a4e..4bf5a2f08b 100644
--- a/railties/test/generators/plugin_new_generator_test.rb
+++ b/railties/test/generators/plugin_new_generator_test.rb
@@ -209,10 +209,10 @@ class PluginNewGeneratorTest < Rails::Generators::TestCase
assert_file "app/views"
assert_file "app/helpers"
assert_file "app/mailers"
+ assert_file "bin/rails"
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
@@ -246,15 +246,15 @@ class PluginNewGeneratorTest < Rails::Generators::TestCase
def test_usage_of_engine_commands
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'/
+ assert_file "bin/rails", /ENGINE_PATH = File.expand_path\('..\/..\/lib\/bukkits\/engine', __FILE__\)/
+ assert_file "bin/rails", /ENGINE_ROOT = File.expand_path\('..\/..', __FILE__\)/
+ assert_file "bin/rails", /require 'rails\/all'/
+ assert_file "bin/rails", /require 'rails\/engine\/commands'/
end
def test_shebang
run_generator [destination_root, "--full"]
- assert_file "script/rails", /#!\/usr\/bin\/env ruby/
+ assert_file "bin/rails", /#!\/usr\/bin\/env ruby/
end
def test_passing_dummy_path_as_a_parameter
diff --git a/railties/test/generators/shared_generator_tests.rb b/railties/test/generators/shared_generator_tests.rb
index e4924c8386..d203afed5c 100644
--- a/railties/test/generators/shared_generator_tests.rb
+++ b/railties/test/generators/shared_generator_tests.rb
@@ -68,12 +68,12 @@ module SharedGeneratorTests
def test_shebang_is_added_to_rails_file
run_generator [destination_root, "--ruby", "foo/bar/baz", "--full"]
- assert_file "script/rails", /#!foo\/bar\/baz/
+ assert_file "bin/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, "--full"]
- assert_file "script/rails", /#!\/usr\/bin\/env/
+ assert_file "bin/rails", /#!\/usr\/bin\/env/
end
def test_template_raises_an_error_with_invalid_path