Provides around(:all)/around(:context) hooks for RSpec.
In your Gemfile:
gem 'rspec_around_context', git: 'git://gist.github.com/2005175.git'
In a spec:
require 'rspec_around_context'
describe "MyClass" do
around(:context) do |group|
# do something before
group.run_examples
# do something after
end
# or...
around(:context) do |group|
transactionally(&group)
end
end
You may want to check out my blog post about this.
Copyright (c) 2012-2020 Myron Marston. Released under the terms of the MIT license. See LICENSE for details.