-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
before :all / after :all / around :all support #7
Comments
Does it support the spec version of |
I can add support for the spec version of around/around(:all) to minitest-hooks. It can get a little tricky to use though, because you need to use define_method, and super/yield semantics are different inside define_method methods compared to normally defined methods. But this will give people the option to use the DSL version and avoid defining the method manually. |
This around/all problem is pretty nasty, so I have my doubts that minitest-hooks passes all the tests of minitest-around and all the tests in my try on implementing before/after-all hooks #5 If you get minitest-around test-suite to run with minitest-hooks I'm all in favor of switching it though :) |
I've pushed out a 1.1.0 release of minitest-hooks that adds support for block-based around/around(:all) hooks: around(:all) do |&block|
DB.transaction(:rollback=>:always){super(&block)}
end
around do |&block|
DB.transaction(:rollback=>:always, :savepoint=>true, :auto_savepoint=>true){super(&block)}
end @grosser Have you looked at the minitest-hooks implementation and specs? I checked and it does pass the before/after all specs from #5 (I removed the
minitest-hooks has a different API than minitest-around, since minitest-around passes an argument that you have to call, while minitest-hooks just defines a method that allows you to call super. So I couldn't test directly with minitest-around specs. But if you come across something that doesn't work, please open an issue in minitest-hooks. |
@jeremyevans Great work! Let me see if I can run RSpec based fixtures from minttest-around. |
the around seems to be working with some minor ordering issues |
please check out: #8
|
and another one ... this time replacing around with hooks + making it play nice with multiple blocks and not needing to include it by hand |
reopening since this would still be nice to have |
adding |
created new issue for |
This is mentioned in the TODO in the README. You may want to look into integrating minitest-hooks (https://github.com/jeremyevans/minitest-hooks) instead of minitest-around, as minitest-hooks has support for before :all / after :all / around :all hooks, as well as around hooks, and doesn't implement around via Fiber hacks.
The text was updated successfully, but these errors were encountered: