An Adaquate Response by @tenderlove

O boy, do I hate test driven development. Nothing feels
worse than writing clean automated tests only to realize that
they’ve just rendered useless by a small change in an
application feature.
And yet, we writes tests anyway because they pay off in
the long run.

With that in mind, I wanted to write a guide on preparing RSpec
and FactoryGirl for writing Ruby programs. RSpec and FactoryGirl
are great Gems that help you immensely in writing automated
tests, but I’ve had times when I would curse gods in just
prepping RSpec and FactoryGirl.

A Directory Structure of a Ruby Program

There is no one right way to structure a Ruby program.
However, from my experience, I notice myself increasingly
structuring Ruby programs as if I am writing a Ruby Gem.
Others looking at the code understand the program better,
if they are familiar with how Ruby Gems are typically written.
Modularized code helped me debug easier as well.

Let’s say we are writing a Ruby program for a linked list with
a List class and a Node class. Then we will have a directory
structure like below.