This fixes #264. I noticed that issue had the same symptoms that #807 addressed for each_with_index. This pull extends the #807 fix to cover the next case.
Note also that the regression test no_args_method.new.enum_for(:my_method).next.should == nil added here actually hangs prior to this fix (the nexter queue blocked forever waiting for a value that's not coming; now we explicitly feed it the nil), so avoiding that is a nice bonus.
no_args_method.new.enum_for(:my_method).next.should == nil
Between the updated arg handing and avoiding that hang, it seems like there's a chance some specs can be untagged now... I'll have a look soon.
Fix enum arg handling in Nexter
The Nexter for Enumerators needs to have its enum args packed in the
same way as each_with_index. Refactor the arg handling in EachWithIndex
to cover this case too.
Hrm... I see Travis didn't like this pull, but that must be a red herring: I got a clean run on my branch.
Thoughts on the failures noted for this pull: the timeout problem is probably intermittent (needs a tag?), and we can see the String#sub with pattern and block restores $~ after leaving the block failure (here and here) also fail in this unrelated build.
String#sub with pattern and block restores $~ after leaving the block
Hope that helps!
@dmarcotte: I will give your patch a run locally, and see if we need some additional tags to stabilize those failures. Thanks!
🍣 Great :)