3799ea62f7dd298070fcc11499df259c9bb8eb5d
Ruby Technical Test
Dependencies
- Ruby 4.0.6
- Minitest 6.0.6
- Rake 13.4.2
Instructions
Run tests with rake test
New since last review!
As instructed, the functionality has been expanded.
Here is a summary before you dive in:
- Tests are now run via
rake test, and themain.rbscratchpad has been removed. - Product information is now stored in a
Productclass that can be instantiated with an ID, price, and discount if applicable. There is aShopclass that keeps track of these. - The
Checkoutclass still exists, but adding and removing items can now be done in bulk. We still use product IDs when doing this. - Discount logic is encapsulated in a class. Each product can have one kind of discount at the moment, chosen from "Buy X get one free" or "Bulk discount when X are purchased" in order to satisfy requirements.
- New test classes have been created as appropriate, although the bulk of the tests are still against the
Checkoutclass. - See the
setupmethod intests/checkout_test.rbfor a full example of how a shop might be configured.
Languages
Ruby
100%