Skip to content

haletothewood/GildedRubyRose

 
 

Repository files navigation

Build Status

Gilded Rose Refactoring Kata

Completed as part of Tech Test week at Makers Academy written in Ruby and tested in Rspec.

Getting Started

git clone https://github.com/haletothewood/GildedRose-Refactoring-Kata

bundle

Usage

To see the Gilded Rose in action please run:

ruby texttest_fixture.rb

Running tests

rspec

My Approach

I began with extracting the user stories from the requirements provided in the challenge. From this I diagrammed using CRC cards and so had a mental model of the how the update method affected each different item. I began by writing all the tests for the different items. This gave me a base to begin refactoring and a story to match my new methods narrative to. I went through each test for an item and wrote the simplest code in a new method to make the test pass. Once I hit green I refactored. After each items update functionality was extracted into a private method I began the process of extracting into separate classes. As the instructions made it clear not to edit Item, I used inheritence to create a Normal item from Item and further inheritence for each special item from Normal item.

About

Makers Academy - Week 10 Tech Test Challenge

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%