Skip to content
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

Q: Why fibers? #24

Closed
jrochkind opened this issue Oct 31, 2014 · 8 comments
Closed

Q: Why fibers? #24

jrochkind opened this issue Oct 31, 2014 · 8 comments

Comments

@jrochkind
Copy link

Not an issue, just wondering if you could share just a few words on why the current version of minitest-around uses Fibers, what motivated that choice?

I am greatly missing around from Minitest/spec, and am considering this gem, but want to understand what it's doing and why first to make sure I understand what I'm getting into. It's not obvious to me the benefit of using Fibers there instead of a simpler implementation (like in older versions of this gem?).

Thanks for any information!

@splattael
Copy link
Owner

/cc @grosser

@grosser
Copy link
Collaborator

grosser commented Nov 8, 2014

fibers was the only way I found to make

  • multiple arounds work
  • correct ordering of before / after / around work

if you find any other way, please make a PR, I'd like to avoid fibers too :)

@jrochkind
Copy link
Author

Interesting, thanks. When I go back in the commit history, I see a version that didn't use fibers I think. It's not clear to me what in that version wouldn't have worked with those factors, but maybe I'll find some time to play around with it and find out for myself.

Thanks for pointing out the requirements that you ran into trouble with -- are those requirements pretty well captured by tests, so if I find an implementation that passes the tests, it's got a pretty good chance of meeting the requirements that you found fibers necessary to meet?

@jrochkind
Copy link
Author

Also I hadn't realized this gem, in addition to supplying around, provided support for multiple before/after's that isn't in original minispec too. True? Would be good to mention in the docs, people may be using this without realizing it gives them multiple before/after power!

@grosser
Copy link
Collaborator

grosser commented Nov 8, 2014

The tests are pretty extensive, so if you get them green your good to go :)

I'll add some docs to the readme.

On Sat, Nov 8, 2014 at 8:18 AM, Jonathan Rochkind notifications@github.com
wrote:

Also I hadn't realized this gem, in addition to supplying around,
provided support for multiple before/after's that isn't in original
minispec too. True? Would be good to mention in the docs, people may be
using this without realizing it gives them multiple before/after power!


Reply to this email directly or view it on GitHub
#24 (comment)
.

@splattael
Copy link
Owner

@grosser Thanks for explaining. We should document it in the README.

@jrochkind In master I've took over most cucumber around scenarios from RSpec. Feel free to play with the implementation :) PRs are very welcome!

Due to vacation my response time remains slow until next week 🌞

@splattael
Copy link
Owner

@jrochkind I don't know if you are still fighting Fibers.

One option is to simply use def around in your spec avoid the Fiber implementation.

For more complete and nicer minitest hooks you might have a look at @jeremyevans' minitest-hooks!

@splattael
Copy link
Owner

As minitest-hooks supports block-based arounds without the usage of Fibers, I will abandon minitest-around soonish.

Please note that minitest-hooks have more minitest-like behavior.

Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants