diff options
Diffstat (limited to 'railties/test/generators_test.rb')
-rw-r--r-- | railties/test/generators_test.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/railties/test/generators_test.rb b/railties/test/generators_test.rb index 9c9a4e6016..4b7b80c7f5 100644 --- a/railties/test/generators_test.rb +++ b/railties/test/generators_test.rb @@ -150,6 +150,13 @@ class GeneratorsTest < GeneratorsTestCase assert_equal "test_unit:generators:plugin", klass.namespace end + def test_fallbacks_for_generators_on_find_by_namespace_with_context + Rails::Generators.fallbacks[:remarkable] = :test_unit + klass = Rails::Generators.find_by_namespace(:remarkable, :rails, :plugin) + assert klass + assert_equal "test_unit:generators:plugin", klass.namespace + end + def test_fallbacks_for_generators_on_invoke Rails::Generators.fallbacks[:shoulda] = :test_unit TestUnit::Generators::ModelGenerator.expects(:start).with(["Account"], {}) @@ -166,10 +173,7 @@ class GeneratorsTest < GeneratorsTestCase Rails::Generators.options[:new_generator] = { :generate => false } klass = Class.new(Rails::Generators::Base) do - def self.name - "NewGenerator" - end - + def self.name() 'NewGenerator' end class_option :generate, :default => true end |