A Test Driven Code Challenge
Thursday 20th June 6:30pm at On the Beach offices, Aeroworks
Rake is a Ruby gem we're all probably familiar with, while a lot of it is hidden under the rails
command, I'm sure some of us fall back to typing rake ...
just through muscle memory because it's a command we've used so often.
One of the lesser known Rake classes is FileList. FileList can take a shell-glob pattern and retrieve all the files in a directory that match that type, such as:
files = Rake::FileList["**/*.yml", "**/*.yaml"]
Essentially, its greater purpose is to create an array with a few helper methods defined to make file manipulation a little easier.
One of the good things about the Rake library is that it's well tested, which brings us onto our challenge. We'll clone a copy of the Rake repo and remove the FileList class, run the tests, see what fails, and try to reimplement the FileList class using only the tests as a guide.
It's a great exercise to do in pairs!