aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators_test.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2009-07-04 19:03:52 +0200
committerJosé Valim <jose.valim@gmail.com>2009-07-04 20:17:32 +0200
commiteeb6a0786a061b640bcd90a5d90bd0d0215fe809 (patch)
treee5c94ea53641fe5a1cb8923a4bbcba69dae76f40 /railties/test/generators_test.rb
parentb277cf28e8a6f5636d0485ab8c04ea0660444440 (diff)
downloadrails-eeb6a0786a061b640bcd90a5d90bd0d0215fe809.tar.gz
rails-eeb6a0786a061b640bcd90a5d90bd0d0215fe809.tar.bz2
rails-eeb6a0786a061b640bcd90a5d90bd0d0215fe809.zip
Load generators from user home and show a error message if they can't be loaded.
Diffstat (limited to 'railties/test/generators_test.rb')
-rw-r--r--railties/test/generators_test.rb8
1 files changed, 7 insertions, 1 deletions
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