diff options
author | Prem Sichanugrist <s@sikachu.com> | 2010-12-31 23:54:49 +0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-01 11:58:09 -0800 |
commit | fd1daf9a8e751aaa700a18d6ac9c48b6f016ea7c (patch) | |
tree | 0e0a57530e2bfbc7cff9cc2b58a50c6179c6713d /railties/test | |
parent | 5c7fd8766586dba42fba6fc738a733175dd9d46b (diff) | |
download | rails-fd1daf9a8e751aaa700a18d6ac9c48b6f016ea7c.tar.gz rails-fd1daf9a8e751aaa700a18d6ac9c48b6f016ea7c.tar.bz2 rails-fd1daf9a8e751aaa700a18d6ac9c48b6f016ea7c.zip |
Make sure that generator's default banner is showing its namespace
This will make `rails g rspec:install --help` shows "rails generate rspec:install [options]" and not "rails generate install [options]"
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/generators_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/railties/test/generators_test.rb b/railties/test/generators_test.rb index 346c9ceb9d..3b3d00b6f1 100644 --- a/railties/test/generators_test.rb +++ b/railties/test/generators_test.rb @@ -120,6 +120,16 @@ class GeneratorsTest < Rails::Generators::TestCase assert_match /^ active_record:fixjour$/, output end + def test_default_banner_should_show_generator_namespace + klass = Rails::Generators.find_by_namespace(:foobar) + assert_match /^rails generate foobar:foobar/, klass.banner + end + + def test_default_banner_should_not_show_rails_generator_namespace + klass = Rails::Generators.find_by_namespace(:model) + assert_match /^rails generate model/, klass.banner + end + def test_no_color_sets_proper_shell Rails::Generators.no_color! assert_equal Thor::Shell::Basic, Thor::Base.shell |