diff options
author | José Valim <jose.valim@gmail.com> | 2009-07-13 23:01:12 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-07-13 23:01:12 +0200 |
commit | 52673cd2eee2bdd65f4ae636f4fdc209186ab868 (patch) | |
tree | edd312bdbc2d24dafa51b6a1ad76410eecbf9700 /railties/test/generators | |
parent | a5ab030ae4ca7496fc9167c9ffa4717be130b235 (diff) | |
download | rails-52673cd2eee2bdd65f4ae636f4fdc209186ab868.tar.gz rails-52673cd2eee2bdd65f4ae636f4fdc209186ab868.tar.bz2 rails-52673cd2eee2bdd65f4ae636f4fdc209186ab868.zip |
Added a generator generator.
Diffstat (limited to 'railties/test/generators')
-rw-r--r-- | railties/test/generators/generator_generator_test.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/railties/test/generators/generator_generator_test.rb b/railties/test/generators/generator_generator_test.rb new file mode 100644 index 0000000000..e31f4eb4be --- /dev/null +++ b/railties/test/generators/generator_generator_test.rb @@ -0,0 +1,26 @@ +require 'abstract_unit' +require 'generators/generators_test_helper' +require 'generators/rails/generator/generator_generator' + +class GeneratorGeneratorTest < GeneratorsTestCase + + def test_generator_skeleton_is_created + run_generator + + %w( + lib/generators/awesome + lib/generators/awesome/USAGE + lib/generators/awesome/templates + ).each{ |path| assert_file path } + + assert_file "lib/generators/awesome/awesome_generator.rb", + /class AwesomeGenerator < Rails::Generators::NamedBase/ + end + + protected + + def run_generator(args=["awesome"], config={}) + silence(:stdout) { Rails::Generators::GeneratorGenerator.start args, config.merge(:root => destination_root) } + end + +end |