1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Prettify generators description whenever using the default stack [#4143 status:resolved]

This commit is contained in:
José Valim 2010-03-12 20:50:36 +01:00
parent fe43bbd8c7
commit b8f7ba2935
2 changed files with 20 additions and 2 deletions

View file

@ -202,6 +202,10 @@ module Rails
rails.delete("app")
print_list("rails", rails)
groups.delete("active_record") if options[:rails][:orm] == :active_record
groups.delete("test_unit") if options[:rails][:test_framework] == :test_unit
groups.delete("erb") if options[:rails][:template_engine] == :erb
groups.sort.each { |b, n| print_list(b, n) }
end

View file

@ -104,11 +104,25 @@ class GeneratorsTest < Rails::Generators::TestCase
def test_rails_generators_with_others_information
output = capture(:stdout){ Rails::Generators.help }
assert_match /ActiveRecord:/, output
assert_match /Fixjour:/, output
assert_match /^ fixjour$/, output
end
def test_rails_generators_does_not_show_activerecord_info_if_its_the_default
output = capture(:stdout){ Rails::Generators.help }
assert_no_match /ActiveRecord:/, output
assert_no_match /^ active_record:model$/, output
assert_no_match /^ active_record:fixjour$/, output
end
def test_rails_generators_shows_activerecord_info_if_its_not_the_default
Rails::Generators.options[:rails][:orm] = :data_mapper
output = capture(:stdout){ Rails::Generators.help }
assert_match /ActiveRecord:/, output
assert_match /^ active_record:model$/, output
assert_match /^ active_record:fixjour$/, output
assert_match /^ fixjour$/, output
ensure
Rails::Generators.options[:rails][:orm] = :active_record
end
def test_no_color_sets_proper_shell