Testing

  • Avoid let, subject, before => Mystery guests

let can be overriden by another let. Can be overriden by variables. Once you figured out what a method does, you know how it works.

I tests can be run by itself. Very easy to know what I’m testing, what’s been exercised, and what is the expected result:

it "..." do
  input

  exercise

  result
end

To have everything in a single test, is easier to fix when a test failed because you have all the contexts around.