diff options
author | Robin Dupret <robin.dupret@gmail.com> | 2015-07-01 16:58:42 +0200 |
---|---|---|
committer | Robin Dupret <robin.dupret@gmail.com> | 2015-07-01 16:58:42 +0200 |
commit | 42b5906523669ba7b80a9fef1c57abd83f1428e8 (patch) | |
tree | 652d556a6a83f0f5bc286a14c99079ca8679f8db /railties/test/generators | |
parent | bc71e43252c49e990dbe22ee0cb3c017a6026d04 (diff) | |
download | rails-42b5906523669ba7b80a9fef1c57abd83f1428e8.tar.gz rails-42b5906523669ba7b80a9fef1c57abd83f1428e8.tar.bz2 rails-42b5906523669ba7b80a9fef1c57abd83f1428e8.zip |
Display a more human readable list of reserved names
Interpolating an array inside a String will call #inspect on it. Let's
call #join to display a more human-readable error message.
Diffstat (limited to 'railties/test/generators')
-rw-r--r-- | railties/test/generators/plugin_generator_test.rb | 2 | ||||
-rw-r--r-- | railties/test/generators/shared_generator_tests.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/railties/test/generators/plugin_generator_test.rb b/railties/test/generators/plugin_generator_test.rb index d6e5f4bd89..73e68863f4 100644 --- a/railties/test/generators/plugin_generator_test.rb +++ b/railties/test/generators/plugin_generator_test.rb @@ -38,7 +38,7 @@ class PluginGeneratorTest < Rails::Generators::TestCase 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: [\"application\", \"destroy\", \"plugin\", \"runner\", \"test\"]\n", content + assert_equal "Invalid plugin name plugin. Please give a name which does not match one of the reserved rails words: application, destroy, plugin, runner, test\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 diff --git a/railties/test/generators/shared_generator_tests.rb b/railties/test/generators/shared_generator_tests.rb index f983b45d2b..77372fb514 100644 --- a/railties/test/generators/shared_generator_tests.rb +++ b/railties/test/generators/shared_generator_tests.rb @@ -56,7 +56,7 @@ module SharedGeneratorTests reserved_words = %w[application destroy plugin runner test] reserved_words.each do |reserved| content = capture(:stderr){ run_generator [File.join(destination_root, reserved)] } - assert_match(/Invalid \w+ name #{reserved}. Please give a name which does not match one of the reserved rails words: \["application", "destroy", "plugin", "runner", "test"\]\n/, content) + assert_match(/Invalid \w+ name #{reserved}. Please give a name which does not match one of the reserved rails words: application, destroy, plugin, runner, test\n/, content) end end |