-
Notifications
You must be signed in to change notification settings - Fork 0
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
Rollbar: 2clove bug #112
Comments
…ermine if unit is valid before using.
…compatible units before adding/subtracting using unit1.compatible?(unit2)
Asked question of ruby-units author for how best to handle unit validity checks. |
…mpat check before unit add/sub, but still needs a check for not-a-unit
…o ingredient model, avoids checking compatibility for non-united ingredients.
…th ingredient.sub not returning false if not found.
…try to find the source of the remaining failed test. No dice.
…el test. The short circuit in the sub() function in ingredient doesn't appear to actually avoid hitting the false state where the whole ingredient is removed. Not sure why. Research required on short circuiting functions via returns in ruby.
…stom matcher for collections, rewrote test that involved removing a recipe and not losing particular ingredients in the current grocery list
I'll review the rest of this, but take a look at the test I built (including the nifty custom matcher I researched) @johnhutch |
shit, man. That custom matcher is fantastic. Any chance you saved the link where you read about it? I'd like to pinboard it. As for the rest of the issue, review approved? |
app/helpers/application_helper.rb app/models/ingredient.rb
Is this redundant? Or is it important to know if just one is unitless for the next else block? I see it twice in this file |
nope.
It's important to know if just one is unitless because if EITHER is unitless, we can't try to do unit math with it. Another way to state the logic tree would be: If neither item is unitless, add or subtract as units. |
Pushed to PROD. Ready for the second round of QA. |
Tested on live by adding a recipe with the following ingredient list (which originally tripped the error -- sorry, this should have been in the bug description): 5 tbsp soy sauce |
ArgumentError: '2clove' Unit not recognized
The text was updated successfully, but these errors were encountered: