Requirements: Ruby >1.9.3, git, minitest
gem.
Once you clone the repo, run:
bundle install
Each folder is named after the refactoring pattern they tackle, and contains:
app.rb
code we'll refactor.setup.rb
necessary code forapp.rb
to run (just a basic framework) We don't need to see/edit it.tests.rb
self explanatory. Necessary for refactoring.
You may run tests by running app.rb
file, so for the first example:
$ ruby 1-intention-revealing-method/app.rb
Run options: --seed 16319
# Running:
....
Finished in 0.001447s, 2765.0585 runs/s, 3456.3231 assertions/s.
4 runs, 5 assertions, 0 failures, 0 errors, 0 skips
-
Intention Revealing Method
-
Special Case Object
-
Replace Method with Method Object
This workshop is based on: https://github.com/tute/refactoring-workshop
So all the credits goes to him.