finnlabs/rspec-example_disabler — pull request #1 by myabc (2014-04-09 11:47:57+00:00)
Title: First attempt at solution to disable after hooks

When an example is marked as "disabled" (or pending), we must ensure
that after hooks as well as before hooks are disabled. Calling
`pending` in the before method only disable the before hook and
example.

This issue came to light in Controller specs with the upgrade to
rspec ~2.14: with `render_views` disabled, the `ViewRendering` adds
before and after hooks to Controller examples that set and read an
instance variable (ivar). When only the after hook is executed, the
ivar is null, resulting in a `NoMethodError`:

undefined method `original_path_set' for nil:NilClass

See: https://github.com/rspec/rspec-rails/blob/2-3-maintenance/lib/rspec/rails/view_rendering.rb#L59

I have not been able to ascertain exactly what change in the rspec
source resulted in this difference in behaviour.

Signed-off-by: Alex Coles