aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators/shared_generator_tests.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/test/generators/shared_generator_tests.rb')
-rw-r--r--railties/test/generators/shared_generator_tests.rb22
1 files changed, 6 insertions, 16 deletions
diff --git a/railties/test/generators/shared_generator_tests.rb b/railties/test/generators/shared_generator_tests.rb
index 85a90cd968..d203afed5c 100644
--- a/railties/test/generators/shared_generator_tests.rb
+++ b/railties/test/generators/shared_generator_tests.rb
@@ -27,20 +27,10 @@ module SharedGeneratorTests
end
def test_generation_runs_bundle_install
- generator([destination_root]).expects(:bundle_command).with('install --binstubs').once
+ generator([destination_root]).expects(:bundle_command).with('install').once
quietly { generator.invoke_all }
end
- def test_generation_runs_bundle_install_with_shebang_if_needed
- original_path = ENV["PATH"]
- ENV["PATH"] = ENV["PATH"] + ":" + File.expand_path("../../fixtures/path", __FILE__)
-
- generator([destination_root]).expects(:bundle_command).with('install --binstubs --shebang ruby-local-exec').once
- quietly { generator.invoke_all }
- ensure
- ENV["PATH"] = original_path
- end
-
def test_plugin_new_generate_pretend
run_generator ["testapp", "--pretend"]
default_files.each{ |path| assert_no_file File.join("testapp",path) }
@@ -58,7 +48,7 @@ module SharedGeneratorTests
def test_options_before_application_name_raises_an_error
content = capture(:stderr){ run_generator(["--pretend", destination_root]) }
- assert_match(/Options should be given after the \w+ name. For details run: rails( plugin)? --help\n/, content)
+ assert_match(/Options should be given after the \w+ name. For details run: rails( plugin new)? --help\n/, content)
end
def test_name_collision_raises_an_error
@@ -78,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
@@ -111,14 +101,14 @@ module SharedGeneratorTests
end
def test_dev_option
- generator([destination_root], dev: true).expects(:bundle_command).with('install --binstubs').once
+ generator([destination_root], dev: true).expects(:bundle_command).with('install').once
quietly { generator.invoke_all }
rails_path = File.expand_path('../../..', Rails.root)
assert_file 'Gemfile', /^gem\s+["']rails["'],\s+path:\s+["']#{Regexp.escape(rails_path)}["']$/
end
def test_edge_option
- generator([destination_root], edge: true).expects(:bundle_command).with('install --binstubs').once
+ generator([destination_root], edge: true).expects(:bundle_command).with('install').once
quietly { generator.invoke_all }
assert_file 'Gemfile', %r{^gem\s+["']rails["'],\s+github:\s+["']#{Regexp.escape("rails/rails")}["']$}
end