diff options
Diffstat (limited to 'railties/test/generators_test.rb')
-rw-r--r-- | railties/test/generators_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/railties/test/generators_test.rb b/railties/test/generators_test.rb index 78c05f2eb8..56c95caa41 100644 --- a/railties/test/generators_test.rb +++ b/railties/test/generators_test.rb @@ -1,5 +1,6 @@ require File.join(File.dirname(__FILE__), 'generators', 'generators_test_helper') require 'generators/rails/model/model_generator' +require 'generators/test_unit/model/model_generator' require 'mocha' class GeneratorsTest < GeneratorsTestCase @@ -114,4 +115,17 @@ class GeneratorsTest < GeneratorsTestCase ensure rm_rf File.dirname(template) end + + def test_fallbacks_for_generators_on_invoke + Rails::Generators.fallbacks[:shoulda] = :test_unit + TestUnit::Generators::ModelGenerator.expects(:start).with(["Account"], {}) + Rails::Generators.invoke "shoulda:model", ["Account"] + end + + def test_fallbacks_for_generators_on_find_by_namespace + Rails::Generators.fallbacks[:remarkable] = :test_unit + klass = Rails::Generators.find_by_namespace(:plugin, :remarkable) + assert klass + assert_equal "test_unit:generators:plugin", klass.namespace + end end |