"Duplication Is Better Than The Wrong Abstraction
The next thing we were told to do goes against all intuition.
Write shameless code, full of duplication just to make the tests green."
It's a lot like the one that Matt, the guy from Wooster, used, saying he'd adopted it from his friend at Pivotal.
The point of being shameless is that repeating yourself is better than prematurely choosing the wrong abstraction. When you head into a problem it might seem so simple that it doesn't warrant too much consideration, however, if you resist the pull to abstract, you might discover a more compelling refactoring pattern once you have enough insight into the problem. The tests facilitate this by passing and then continuing to pass after the refactorings.
The other interesting thing about the shameless technique is that if you have shameful code at the end of the exercise, you didn't add enough tests.
Building reusable code is something that's easier to do in hindsight with a couple of examples of use in the code base, than foresight of ones you might want later. On the plus side, you're probably re-using a lot of code already by just using the file-system, why worry that much? A little redundancy is healthy.
It's good to copy-paste code a couple of times, rather than making a library function, just to get a handle on how it will be used. Once you make something a shared API, you make it harder to change.