Ruby + Rails : Shuffle

by @skillstopractice.com

Shuffled up remix of the Ruby + Rails : Distilled archival feed. Most of the posts there are somewhat timeless. So why not throw some old ones in the gem tumbler and see what comes out?

Pull to refresh
S Gregory Brown [MOVED, SEE BIO] @skillstopractice.com · Jan 8
1

The test for this small change to a shopping cart object passes, but only because it makes the same logical error that the implementation code does. Can you spot what it is doing wrong? And if so, what would the correct `cart.total` be once the code is fixed?

S Gregory Brown [MOVED, SEE BIO] @skillstopractice.com · Jan 9
3

Sometimes this code works just fine (see its output in the console for an example) But run it enough times and you'll find two different broken behaviors as well. Read the code and see if you can figure out what they are without trying to run the program. What's the root cause of the issue?