In my office I have a picture of Step 1 of a Lego build. I don’t actually remember what it was to, but it fascinated me in its simplicity. Because no matter how hard of a Lego model you are going to build, you have to start with a single piece, and connect another piece to it. And I loved that Lego didn’t start with this connection, but instead a single Lego. One step. One Lego.
This idea of a single step is what drives my passion around Test-Driven Development. You don’t know where to start? Write a test. But even then, writer’s block kicks in, and you don’t know what test to write. So go back to the Lego. Write the simplest thing that could possibly work:
it 'should pass the test' do
1.should eq 2
and run it
➜ ruby rspec
1) My tests should pass the test
Failure/Error: 1.should eq 2
(compared using ==)
# ./spec/my_spec.rb:5:in `block (2 levels) in <top (required)>'
Finished in 0.00133 seconds
1 example, 1 failure
rspec ./spec/my_spec.rb:4 # My tests should pass the test
Now make it pass and see green. Your test system is set up. Now you aren’t trying to start something, but merely add to it.
So don’t be overwhelmed by first steps. Start simple. Add to it. And from there, amazing things can happen.