-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Column mapping dangerously applied twice to the same cell! #202
Comments
Hi J.B., I didn't get the failure you did. I used the following:
Even installing a money gem passes:
Yikes! Out of date cucumber. Installed 1.1.4 and got...failure!
Looks like the bug was introduced here possibly? cucumber/common@abb0025#diff-0 |
Thank you for helping nail that down, at least. |
It looks like that commit had a failing spec. Tsk tsk. |
Thanks for reporting this JB. I've never used this feature but it sounds as if the behaviour you expected was reasonable. |
I've exchange email with Richard; I might or might not look into this myself to try to fix it. I would like to, but other priorities have crowded it out for now. |
A quick workaround until this is fixed (check if text is a String)
|
Except when |
yep, my trying to be a smartass here :). I really do in my code what you suggested above... thx for clarifying this |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Wow. This was fun. I don't know how this ever worked. By coincidence, are all the conversion procs that everyone has ever used idempotent?! That would surprise me.
Here's the minimal failing spec (why Money matters will be apparent soon):
This spec fails, because it calls my column mapping proc twice. For example, this causes Table to try to parse "CAD 100" into a Money, then parse that Money object again, which happens to do something weird and annoying. Clearly, that ain't right. Without some weird hack, like refusing to parse something that's already a
Money
, I don't know how to make that conversion proc idempotent. That would seem like an unreasonable requirement.The two calls appear to be in
convert_columns!
andto_hash
. Without digging deeper, it seems to me thatto_hash
ought not to convert the columns directly, when it could useconvert_columns!
, and that method could memoize the result.I don't have the energy to fix this now, and even so, I'd like someone there to confirm that it's indeed a mistake, and that you didn't intend for the conversion procs to need to be idempotent.
Thanks!
The text was updated successfully, but these errors were encountered: