blowmage/minitest-rails — pull request #92 by haines (2013-01-15 01:12:16+00:00)
Title: Enhancements for subclassers of Generators::Base

When I added the Draper generator, I inherited from `MiniTest::Generators::Base` but had to explicitly define a new [`source_root`](https://github.com/drapergem/draper/blob/master/lib/generators/mini_test/decorator_generator.rb#L6-L8) method.

Normally when inheriting from `Rails::Generator::Base`, you just do `source_root File.expand_path(...)` because the [default implementation](https://github.com/rails/rails/blob/v3.2.11/railties/lib/rails/generators/base.rb#L26-L29) uses the optional argument to set the value, falling back to `default_source_root`.

By changing the currently-hardcoded `source_root` to instead be defined in the `default_source_root`, subclasses can still use `source_root` in the normal way.

Also, I had to specify that the `spec` option was available. Since it's an option on all the generators, I think it makes sense to move it up to `Base` so that subclasses don't have to copy it - and to gently push subclassers to write spec templates as well as test templates :)