I did this with Jimmy Sutherland. We refactored the extremely nested code which can be found in the start code here.
We wrote passing tests for all the legacy code, then proceded to refactor and rewrite the code using switch cases, going through each test until they passed.
$ git clone git@github.com:jdm79/gilded-rose-ruby.git
$ cd gilded-rose-ruby
$ bundle
$ rspec
$ ruby texttest_fixture.rb