Leo's Technical Blog
user

Leo's Technical Blog

Mostly about computer programming.


Featured

python, testing

Doctests and XML/XHTML

Posted on .

Every python programmer knows that doctests are really cool. Checking snippets of code just by the literal output that it would print when run on the REPL is both simple and powerful. But, sometimes, they could be too literal. There are options to deal with t…

Featured

python, ruby, testing

Doctests for Ruby

Posted on .

I'm a big fan of Python doctests. They are easy to write (copy and paste from your interpreter), very clean (no subclassing, no assert*, etc.) and serve very well as documentation. Compare this test: def testFactorial(): assertEquals(120, fac(5)) With…