I came across this article today while looking for information about the current state of Ruby + Visual Studio 2005: Unit testing your documentation.
The author of the article is also the author of ‘Ruby Cookbook,’ an Oreilly book in the same vein as the Perl and Python cookbooks. In the article, he talks about, well, unit testing his documentation. More specifically, he wanted to make sure the Ruby snippets in his book would still run and produce the same output as he claims it does. Eventually, he managed to create some scripts to parse out Ruby code + IRB output, extend IRB a bit, and wrap everything up nicely as Test::Unit testcases.
Aside from being interesting to me, the article reminded me of a similar discussion the pragmatic programmers have in their book. If I remember correctly, they wrote scripts to dump sample code + output into their book while it was being compiled by LaTeX.
As far as I know, no one here is actively writing documentation with code snippets in it (I believe Carl and Dave are finished with theirs); nevertheless, I found this article interesting to read while I waited for 39208342 Windows SDKs to install. I’ll have to look into this next time I work on some documents with real code in them.

