hawkthorne/hawkthorne-journey — pull request #1702 by bucketh3ad (2013-09-10 02:47:42+00:00)
Title: Test-driven cheat refactor

**[WIP]**

There is a lot of repetition in the cheat and cheatscreen code. Since reworking "if...elseif...elseif..." doesn't seem horribly complicated nor system critical, I decided to refactor these as a way to familiarize myself with the process of writing passing tests before changing code. It will also simplify adding or changing cheats in the future.

I've made a few basic changes, but I would appreciate feedback before I do more. Are the tests I've written effectively covering the cheats they test? Should I test every cheat, or just a few representative samples like I have now? Any thoughts about my using a test dummy for Player.refreshPlayer?

**TODO:**
- [ ] Refactor item/inventory cheats
- [ ] Refactor cheatscreen.lua
- [ ] Write tests before doing either of the above