This is a repository that can be used as a starting point for doing the String Calculcator code kata. It is based on Roy Osherove's TDD Kata (http://osherove.com/tdd-kata-1/)
There are 3 main branches:
This is the full implementation of the specs and string calculator.
This branch has all the specs implemented and the shell of the StringCalculator module. See instructions for below for practising using this branch.
This is an alternate implementation of the algorithm which relies a little more on regex and the ruby collection methods to give it a more functional feel. This is the same algorithm I used in https://github.com/calebphillips/clojure-string-calculator
- Install rvm
- Clone this repo
- Change into the string calculator directory and let rvm do its magic (follow the instructions to install ruby 1.9.2 and create the gemset if necessary).
git fetch origin specs_only:specs_only
(Fetch the specs_only branch)gem install bundler
bundle install
I think the best way to get started is to use the specs_only branch to memorize the solution first.
git checkout specs_only
bundle exec autotest
- get all the tests to pass
git diff master
(make sure you ended up where you intended to)git reset --hard HEAD
(this deletes your local changes)- repeat
Copyright (c) 2009 Corey Haines. See LICENSE for details.