From: "Mauricio Fernández" Date: 2004-10-19T06:57:09+09:00 Subject: Re: documentation as source On Tue, Oct 19, 2004 at 05:09:22AM +0900, Massimiliano Mirra - bard wrote: > Eivind Eklund writes: > > > Could people (excepting Nathaniel) that is likely to use the proposed > > syntax please speak up? (If there's a lot of people that would use > > it, I'm probably wrong.) > > I'm for any syntax that favours a quick code-test-code cycle. > > With `quick' I don't mean `edit test file, save test file, switch to > class file, edit class file, save test file, switch to shell, run > tests', and an `extract parts of the test file' somewhere in between > certainly doesn't make it quicker. That's not really the case because... > By `quick' I mean `edit test part, edit class part, run tests'. > Currently I do this by writing tests at the end of a class file, > wrapped in a: > > if __FILE__ == $0 or (defined? $TESTING and $TESTING == true) > require "test/unit" require "text-extract" Extracter.process(__FILE__) > ... > end > > Just hitting C-c-c in Emacs at any given time will run the current > class's tests. And it really is quicker *g*, for the code examples will not be parsed normally. -- Running Debian GNU/Linux Sid (unstable) batsman dot geo at yahoo dot com