-
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
replace around with hooks #9
Conversation
@splattael what do you think of putting this into minitest-around so an alternative is out there as gem ? |
So it's not implemented? require "maxitest/autorun"
require "minitest/hooks"
describe "" do
before :all do
p :all
end
it "1" do p 1 end
it "2" do p 2 end
end
UPD: Oh wait, I guess I'm doing something wrong. It is the same with plain minitest either. Am I misusing the dsl? |
do you need to use minitest/hooks ? |
ah same without :/ |
ah yeah that never worked ... I think the argument is just ignored, would be nice to raise argumenterror |
and a PR to make |
let_all :_ do
p :all
end
before do
_
end works! Thank you for a quick response. |
This hack is weird though in the way that if there was an exception in let_all it gets reevaluated for every example. |
maybe don't call it |
yeah, but caching exceptions is also super weird :) |
Some workaround to not reevaluate if failed: describe "" do
let_all :before_all do
p :all
fail
true
rescue
end
before{ before_all or fail }
it "1" do p 1 end
it "2" do p 2 end
end
|
Or even let_all :before_all do
p :all
fail "all"
false
rescue
$!
end
before{ before_all and fail before_all } to reraise the caught error. |
#53 to block these broken cases and add |
afaik this is not doable atm without making the ordering un-intuitive |
No description provided.