This blog post is essential reading for Python developers who see doctest.js and think "ew, doctest": <a href="http://blog.ianbicking.org/2012/10/02/why-doctest-js-is-better-than-pythons-doctest/" rel="nofollow">http://blog.ianbicking.org/2012/10/02/why-doctest-js-is-bett...</a>
I'm impressed. I really thought I'd seen all approaches to unit testing, but apparently I hadn't. This really appeals to me!<p>Is there anyone here who's been using DocTest and has some experiences to share?<p>I love how, as a side effect, this approach to unit testing encourages implementing a good toString / __str__ on each class. In those languages that have that, of course.
If you could combine this with a Literate Programming approach like Literate CoffeeScript[1], then the examples in your API documentation could also become the executable tests.<p>1: <a href="https://github.com/jashkenas/coffee-script/issues/1786" rel="nofollow">https://github.com/jashkenas/coffee-script/issues/1786</a>