diff options
author | Philip Arndt <parndt@gmail.com> | 2011-01-29 11:05:24 +0800 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-01-29 16:51:41 +0800 |
commit | 34fef7e258a24c389fa211c51dc4217b050b03be (patch) | |
tree | 68d566fddead9ab192932d0ddd1ea53230a40c9c | |
parent | d6fd5821dab547fe183ffb58cb1cf8031c86e736 (diff) | |
download | rails-34fef7e258a24c389fa211c51dc4217b050b03be.tar.gz rails-34fef7e258a24c389fa211c51dc4217b050b03be.tar.bz2 rails-34fef7e258a24c389fa211c51dc4217b050b03be.zip |
Added test to ensure non zero exit codes when generating an application with a reserved name.
Unfortunately, I can't find out how to suppress its output so we see ....Invalid application name test. Please give a name which does not match one of the reserved rails words.....................................
-rw-r--r-- | railties/test/generators/app_generator_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index 28b20d4206..919823070b 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -64,6 +64,13 @@ class AppGeneratorTest < Rails::Generators::TestCase assert_file "things-43/config/application.rb", /^module Things43$/ end + def test_application_new_exits_with_non_zero_code_on_failure + Dir.chdir(destination_root) do + `rails new test` + end + assert_equal false, $?.success? + end + def test_application_name_is_detected_if_it_exists_and_app_folder_renamed app_root = File.join(destination_root, "myapp") app_moved_root = File.join(destination_root, "myapp_moved") |