[BioRuby] doctests for BioRuby
Toshiaki Katayama
ktym at hgc.jp
Mon Feb 4 04:58:38 UTC 2008
Pj,
I don't want to have this in the bioruby package for now, because:
* it seems to be a general application
* we need only one way for testing codes (unless you convert all unit tests in the bioruby distribution to doctest)
If the doctest is your products, how about to release it as a gem package?
Toshiaki
On 2008/02/03, at 19:05, Pjotr Prins wrote:
> I have a doctest.rb program that works with BioRuby. Basically you can run
>
> doctest.rb [-v] sourcefilename(s) e.g.
>
> ruby doctest.rb -v Tutorial.rd
> Looking for doctests in 1 files
> Processing 'Tutorial.rd'Testing 'Testing bioruby'...OK
> Total tests: 1; assertions 2; succeeded: 2
>
> Where in this case the Tutorial.rd contains bioruby shell type (you
> can check it!):
>
> bioruby> seq = Bio::Sequence::NA.new("atgcatgcaaaa")
> ==> "atgcatgcaaaa"
>
> bioruby> seq.complement
> ==> "ttttgcatgcat"
>
> The cool thing is allows writing tests in documentation - doubling as
> a unit or regression test and ascertaining the examples in the
> documentation are still valid. doctest is big in the Python
> community, and I think it is a very good idea. See
> http://docs.python.org/lib/module-doctest.html
>
> Question: where should I store this functionality? Should the script
> go into:
>
> ./bin/
> ./bin/extra/ (my preference)
> ./test
>
> or even
>
> ./lib/test/doctest/
> ./lib/testing/doctest/
>
> At this point doctest.rb is not a module - though that may be useful
> when people start using doctests in place of unit tests.
>
> Pj.
>
>
> _______________________________________________
> BioRuby mailing list
> BioRuby at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioruby
More information about the BioRuby
mailing list