Closed rsl closed 11 years ago
super fast. thanks.
Thanks! I merged this in to give you credit for bringing it to our attention, but what's stopping us from just avoiding the assert_block
method altogether? Is there a reason we can't just use assert
and avoid the safe_assert_block
?
hrm. i actually didn't think to do that at all. i think in the back of my head assert was modified to take assert_block's place. makes sense that assert out of the box would do that. feel stupid for not having thought of it. ;)
i assumed no one used plain assert because it used to not work. so i wanted to make sure those users were supported but yeah... yeah. ;)
I tried a quick transition to just using assert
but the test suite fails because it expects a different format of failed test output for that assertion. If it's something you're interested in investigating, much appreciated. Otherwise, I'll come back to it at some later date, probably.
poking it now.
there's a lot of places that can/do define assert there. stdlib's test/unit. rubygem test-unit. minitest. all of which have some differences in versions. looks like it might be bugger trying to unify that in a single call to assert.
MiniTest 4.6.0 and higher no longer has assert_block as a method [opting for assert(yield, message)] https://github.com/seattlerb/minitest/blob/master/History.txt#L134-L140
This enables users with older MiniTest to still use assert_block if it's there and the newer format if it's not.
Not sure how to write a test for this as it is a dependency-based issue.