rspec/rspec-core — pull request #638 by myronmarston (2012-06-16 06:41:46+00:00)
Title: Don't add `describe` to every object.

Instead, make it only available on:
- The main object--so it can be used at the top level.
- Modules--so example groups can be declared nested
within modules, as is the common practice.

Besides this, the only other place we need describe is from within
example groups (so we can nest them), and this is taken care of by
RSpec::Core::ExampleGroup.describe.

I got the idea for this from a recent change in Sinatra that similarly
limits the DSL to just the main object rather than all objects:

https://github.com/sinatra/sinatra/commit/46bdb7dcf842afdb3bce57a6753eb4d909b1225d

There is some risk to this change, since it is removing `describe` from lots of objects it was available on previously, but users shouldn't be calling #describe on any object willy-nilly, anyway. The rspec-expectations and rspec-mocks specs pass with this change (as well as the rspec-core specs, of course).

Thoughts?

/cc @dchelimsky @patmaddox @alindeman @justinko @spicycode