rails/rails — pull request #11419 by simi (2013-07-13 12:11:06+00:00)
Title: Added generated unit test for generator generator.

## Before this patch

no test was generated for ```rails g generator awesome```.

## With this patch

For ```rails g generator awesome``` is generated:

```ruby
# test/lib/generators/awesome_generator_test.rb
require 'test_helper'
require 'generators/awesome/awesome_generator'

class AwesomeGeneratorTest < Rails::Generators::TestCase
tests AwesomeGenerator
destination Rails.root.join('tmp/generators')
setup :prepare_destination

# arguments %w(awesome)

# test "generator skeleton is created" do
# 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
end
```

## Problems
I'm not sure what to put into this dumb generated test. How to setup destination and if we need any sample commented test.

I have problem with autoloading tests in ```test/lib```. I found [article](http://socialmemorycomplex.net/2012/06/27/add-your-rails-3-lib-tests-to-rake-test/) how ti achieve it with some hacks, but I'm not sure if it shouldn't be in default now. ```rake test``` ignores generated tests in ```test/lib/generators``` now.

I added ```require 'rails/generators/test_case'``` into ```railties/lib/rails/test_help.rb```. I'm not sure how big dependency is it. Maybe we could require it per test file.

### Summary:
* generator test template
* autoload tests in ```test/lib/generators```
* new ```railties/libPrails/test_help``` dependency

/cc @steveklabnik