diff options
author | Robin Böning <rb@magiclabs.de> | 2014-01-05 21:48:05 +0100 |
---|---|---|
committer | Robin Böning <rb@magiclabs.de> | 2014-01-06 11:28:04 +0100 |
commit | 6cc087b28d8789c14b5adffe861ad257c829090b (patch) | |
tree | 03aecaee7755c8a749ee84b4f63ad21806de2849 /railties/test/generators | |
parent | 6b548830828e4e910de7854d21717c17303e089c (diff) | |
download | rails-6cc087b28d8789c14b5adffe861ad257c829090b.tar.gz rails-6cc087b28d8789c14b5adffe861ad257c829090b.tar.bz2 rails-6cc087b28d8789c14b5adffe861ad257c829090b.zip |
Add missing tests for invalid names in `rails plugin new`
* Test for: Invalid plugin name, because of reserved rails word.
* Test for: Invalid plugin name because of constant name that is already in use.
Diffstat (limited to 'railties/test/generators')
-rw-r--r-- | railties/test/generators/plugin_generator_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/railties/test/generators/plugin_generator_test.rb b/railties/test/generators/plugin_generator_test.rb index f5f2495e7d..932cd75bcb 100644 --- a/railties/test/generators/plugin_generator_test.rb +++ b/railties/test/generators/plugin_generator_test.rb @@ -35,6 +35,12 @@ class PluginGeneratorTest < Rails::Generators::TestCase content = capture(:stderr){ run_generator [File.join(destination_root, "43things")] } assert_equal "Invalid plugin name 43things. Please give a name which does not start with numbers.\n", content + + content = capture(:stderr){ run_generator [File.join(destination_root, "plugin")] } + assert_equal "Invalid plugin name plugin. Please give a name which does not match one of the reserved rails words.\n", content + + content = capture(:stderr){ run_generator [File.join(destination_root, "Digest")] } + assert_equal "Invalid plugin name Digest, constant Digest is already in use. Please choose another plugin name.\n", content end def test_camelcase_plugin_name_underscores_filenames |