-
-
Notifications
You must be signed in to change notification settings - Fork 354
Reorganize marshal code. #329
Conversation
- This appears to fix rspec/rspec-core#950. - It's better, anyway, since it bypasses the unnecessary shifting/unshifting for this case.
BTW, we should merge this into master and 2-99 as well, eventually. I want to sit on this for a bit and see if I can figure more out about it. |
Wow, nice debugging. Very odd problem. |
I agree this is better. Maybe we could write a spec that |
That sounds good, but I'm not really sure how to do that, given that the shift/unshift should result in the same array, right? I guess we could mock it, and assert that it's the same array instance, but even though, I'm not sure how to do that given that the args array is just a by-product of our use of splats and isn't actually passed in as an argument to the method... Do you have an idea how to write such a spec? |
@alindeman -- one other thought I had...I'm thinking about removing the marshal extension in 3.0. It's only needed to work around the Thoughts? |
I'm in favour of removing the I'm also curious about why the shift/unshift is affecting drb, could it be a referencing issue? (Are the array's memory locations different after the shift/unshift operation?) Did you try just using args[0] rather than object? |
I think it'd be good to try to avoid mutation here as @JonRowe says. Then we may not really need the spec that I'm talking about. |
Is everyone cool if I take this, remove the mutation, and merge? |
Yes, as long as you test it against the original source of the problem: https://github.com/myronmarston/recurring_select/tree/rspec-troubleshooting I don't understand why what we had was broken and why my fix fixes it...so I don't want a refactoring happening w/o verifying that. What branches do you plan to merge this in to? |
I'm cool with this provided it passes @myronmarston's test. |
Opened #335 with specs. I resolved the |
Resolved with #335 :) |
shifting/unshifting for this case.
I'd love if we had a failing spec for this but I don't really understand marshal and DRB to understand how the old logic was causing this bug. This change seems logically identical but it fixes the problem :/