diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-03 13:01:18 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-03 17:14:49 +0100 |
commit | e88ea3255ff90baa28d30908e1fcb5fa7f7133a8 (patch) | |
tree | 5ffcba7d4eb7add6ff5ddb2b5c3446838a4fd8a5 /railties/test | |
parent | 6716e4bc0c201d9375fa07b44c1a96b6948fc6ab (diff) | |
download | rails-e88ea3255ff90baa28d30908e1fcb5fa7f7133a8.tar.gz rails-e88ea3255ff90baa28d30908e1fcb5fa7f7133a8.tar.bz2 rails-e88ea3255ff90baa28d30908e1fcb5fa7f7133a8.zip |
Assert for valid application names. [#3556 status:resolved]
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/generators/app_generator_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index 2cba42551e..235da530f9 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -53,6 +53,16 @@ class AppGeneratorTest < GeneratorsTestCase assert_match /Invalid value for \-\-database option/, content end + def test_invalid_application_name_raises_an_error + content = capture(:stderr){ Rails::Generators::AppGenerator.start [File.join(destination_root, "43-things")] } + assert_equal "Invalid application name 43-things. Please give a name which does not start with numbers.\n", content + end + + def test_invalid_application_name_is_fixed + silence(:stdout){ Rails::Generators::AppGenerator.start [File.join(destination_root, "things-43")] } + assert_file "things-43/config/environment.rb", /Things43::Application/ + end + def test_config_database_is_added_by_default run_generator assert_file "config/database.yml", /sqlite3/ |