Skip to content
This repository
Browse code

Tests for new reserved words [#4602 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
commit 7be58b616337d28dc6f25e9dc26cca935437ec12 1 parent b7bdacf
Simon Jefford authored josevalim committed
9  railties/test/generators/app_generator_test.rb
@@ -70,8 +70,13 @@ def test_options_before_application_name_raises_an_error
70 70
   end
71 71
 
72 72
   def test_name_collision_raises_an_error
73  
-    content = capture(:stderr){ run_generator [File.join(destination_root, "generate")] }
74  
-    assert_equal "Invalid application name generate. Please give a name which does not match one of the reserved rails words.\n", content
  73
+    reserved_words = %w[generate g console c server s dbconsole db
  74
+                        application destroy benchmarker profiler
  75
+                        plugin runner test]
  76
+    reserved_words.each do |reserved|
  77
+      content = capture(:stderr){ run_generator [File.join(destination_root, reserved)] }
  78
+      assert_equal "Invalid application name #{reserved}. Please give a name which does not match one of the reserved rails words.\n", content      
  79
+    end
75 80
   end
76 81
 
77 82
   def test_invalid_database_option_raises_an_error

0 notes on commit 7be58b6

Please sign in to comment.
Something went wrong with that request. Please try again.