We have quite a bit of tests in our RSpec test suite. directory structure looks something like -
spec/
truncation/
example1_spec.rb
example2_spec.rb
...
transaction/
example1_spec.rb
example2_spec.rb
...
I wanted to restore a test database dump, before all of the spec files in transaction/ folder are run and empty it after all tests finish.
Is there a way to do this?
There are before(:suite) and after(:suite) hooks but these work for individual spec files.
Is there a way to provide before and after hooks for directories in RSpec?