Skip to content

Preserve return value in MiniTest example #521

Merged
merged 1 commit into from Jul 19, 2012

3 participants

@mjackson

The return value of MiniTest::Unit::TestCase is significant and needs
to be returned in order for the test reporter to work properly.

I also added an example for overriding the base implementation instead
of doing it in a subclass.

@mjackson mjackson Preserve return value in MiniTest example
The return value of MiniTest::Unit::TestCase is significant and needs
to be returned in order for the test reporter to work properly.

I also added an example for overriding the base implementation instead
of doing it in a subclass.
fd7fe65
@jeremyevans
Owner

This makes sense, I'll merge it tomorrow. Thanks for the help!

Glad to see you are using the block-based transaction API. :)

@jeremyevans jeremyevans merged commit fd7fe65 into jeremyevans:master Jul 19, 2012
@janko-m
janko-m commented May 4, 2015

Doesn't #transaction always return the return value of the block? If yes, I think it's better to revert to the previous way, because it's less verbose (and it shows that Minitest's setup is just as pretty as RSpec's 😃).

@jeremyevans
Owner

I believe transaction currently returns the block status only if an exception is not raised, and :rollback=>:always raises a rollback exception internally. Now that minitest-hooks is available, I should add an example that uses minitest-hooks and shows how you can get per-suite transactions with per-example savepoints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.