From eeb6a0786a061b640bcd90a5d90bd0d0215fe809 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Sat, 4 Jul 2009 19:03:52 +0200 Subject: Load generators from user home and show a error message if they can't be loaded. --- railties/test/generators_test.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'railties/test/generators_test.rb') diff --git a/railties/test/generators_test.rb b/railties/test/generators_test.rb index c7195f753d..964def4158 100644 --- a/railties/test/generators_test.rb +++ b/railties/test/generators_test.rb @@ -81,7 +81,13 @@ class GeneratorsTest < GeneratorsTestCase def test_rails_generators_with_others_information output = capture(:stdout){ Rails::Generators.help }.split("\n").last - assert_equal "Others: active_record:fixjour, fixjour, mspec, rails:javascripts.", output + assert_equal "Others: active_record:fixjour, fixjour, mspec, rails:javascripts, wrong.", output + end + + def test_warning_is_raised_if_generator_cant_be_loaded + output = capture(:stderr){ Rails::Generators.find_by_namespace(:wrong) } + assert_match /\[WARNING\] Could not load generator at/, output + assert_match /Error: uninitialized constant Rails::Generator/, output end def test_no_color_sets_proper_shell -- cgit v1.2.3