This is because you are using around(:each)
wrong I think. In order to do this properly, you have to pass your test into the block as an argument. When you run this test:
around(:each) do | example |
p "Before the test"
example.run
p "After the test"
end
The output of your test file using this code would be:
"Before the test"
"On before each block"
"After the test"
What your code is doing is ignoring the before
block and just executing your around
(the 1+1=2
test is never actually run). The documentation for this can be found here:
http://rubydoc.info/gems/rspec-core/RSpec/Core/Hooks#around-instance_method