O'Reilly logo

Rails 4 Test Prescriptions by Noel Rappin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Making Our Test Pass

Now it’s time to make our first test pass.

But how?

It seems like a straightforward question, but it has a few different answers.

  • The purist way: Do the simplest thing that could possibly work. In this case “work” means “minimally pass the test without regard to the larger context.” Or it might even mean “write the minimum amount of code to clear the current error without regard to the larger context.”

  • The “practical” way, scare quotes intended: Write the code you know you need to eventually write, effectively skipping steps that seem too small to be valuable.

  • The teaching way, which is somewhere in between the other two and lets me best explain how and why test-driven development works without getting bogged down in details ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required