Permalink
Browse files

Merge pull request #13611 from robinboening/plugin_generator_tests

Add missing tests for invalid names in `rails plugin new` generator
  • Loading branch information...
2 parents a6da73f + 6cc087b commit 1ce0a2a68ac658276fa02faddebb0dde86a92d22 @senny senny committed Jan 6, 2014
Showing with 6 additions and 0 deletions.
  1. +6 −0 railties/test/generators/plugin_generator_test.rb
@@ -35,6 +35,12 @@ def test_invalid_plugin_name_raises_an_error
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

0 comments on commit 1ce0a2a

Please sign in to comment.