Make Rspec 3 compliant

Change explicit use of `example` variable to using the block value that
is passed in to examples and before/after hooks.
Correct reference to wrong block variable name
Fix accidental editing error
Merge pull request #1123 from thomas-holmes/update-rspec-configuration

Make Rspec 3 compliant