diff options
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/generators/app_generator_test.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index 85081609de..3e3cd90bed 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -55,16 +55,21 @@ class AppGeneratorTest < GeneratorsTestCase end def test_invalid_application_name_raises_an_error - content = capture(:stderr){ Rails::Generators::AppGenerator.start [File.join(destination_root, "43-things")] } + content = capture(:stderr){ run_generator [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")] } + run_generator [File.join(destination_root, "things-43")] assert_file "things-43/config/environment.rb", /Things43::Application\.initialize!/ assert_file "things-43/config/application.rb", /^module Things43$/ end + def test_application_names_are_not_singularized + run_generator [File.join(destination_root, "hats")] + assert_file "hats/config/environment.rb", /Hats::Application\.initialize!/ + end + def test_config_database_is_added_by_default run_generator assert_file "config/database.yml", /sqlite3/ |