diff options
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/generators_test.rb | 13 | ||||
-rw-r--r-- | railties/test/generators_test.rb | 6 |
2 files changed, 8 insertions, 11 deletions
diff --git a/railties/test/application/generators_test.rb b/railties/test/application/generators_test.rb index 3c52a07bdb..8b840fffd0 100644 --- a/railties/test/application/generators_test.rb +++ b/railties/test/application/generators_test.rb @@ -26,17 +26,8 @@ module ApplicationTests end test "allow running plugin new generator inside Rails app directory" do - FileUtils.cd rails_root do - `ruby script/rails plugin new vendor/plugins/bukkits` - assert File.exist?(File.join(rails_root, "vendor/plugins/bukkits/test/dummy/config/application.rb")) - end - end - - test "don't allow running plugin_new generator as a generator" do - FileUtils.cd rails_root do - output = `ruby script/rails g plugin_new vendor/plugins/bukkits` - assert_match /This generator should not be used directly as a generator. You should use `rails plugin new` command instead/, output - end + FileUtils.cd(rails_root){ `ruby script/rails plugin new vendor/plugins/bukkits` } + assert File.exist?(File.join(rails_root, "vendor/plugins/bukkits/test/dummy/config/application.rb")) end test "generators default values" do diff --git a/railties/test/generators_test.rb b/railties/test/generators_test.rb index f93800a5ae..346c9ceb9d 100644 --- a/railties/test/generators_test.rb +++ b/railties/test/generators_test.rb @@ -102,6 +102,12 @@ class GeneratorsTest < Rails::Generators::TestCase assert_no_match /^ app$/, output end + def test_rails_generators_help_does_not_include_app_nor_plugin_new + output = capture(:stdout){ Rails::Generators.help } + assert_no_match /app/, output + assert_no_match /plugin_new/, output + end + def test_rails_generators_with_others_information output = capture(:stdout){ Rails::Generators.help } assert_match /Fixjour:/, output |