The Gilded Rose is a famous kata (or exercise) in OO, testing, and refactoring legacy code. By completing this kata, you will master the proper use of inheritance, by using it to eliminate conditionals in a wide-but-not-deep tree.
- Watch this video by Sandi Metz.
- Fork & clone this repository
- npm install
- npm test (to insure tests run without problems before refactoring)
- Refactor, following the example set by Ms. Metz
- Verify the tests still pass
- If time allows uncomment the "Conjured Item" tests and extend the solution to turn them green.
Node: do not alter the 40 line if statement. Rewrite it then delete it like in the video.
At 10:28 in the video, Ms. Metz talks about how to create "a seam". Follow this procedure to avoid having to understand the deeply nested conditionals.
Use IntelliJ's run with coverage feature:
Observe the red lines of code and turn them green!