thoughtbot/guides — pull request #256 by georgebrock (2014-11-21 16:04:47+00:00)
Title: Add guideline for using described_class

The `described_class` method in RSpec returns the class passed to the outer-most `describe` block. Using it makes it significantly easier to rename classes.

I was using this in some unit specs in gitsh, but not in others. When @mike-burns and I did some restructuring and moved a bunch of classes around, it was much easier for the specs that were already using `described_class` (see: https://github.com/thoughtbot/gitsh/commit/c1dc545c21a8037f47d71bf8ca01e667433f6d6e).

Documentation: https://www.relishapp.com/rspec/rspec-core/docs/metadata/described-class