[
https://issues.apache.org/jira/browse/COUCHDB-1865?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13723667#comment-13723667
]
Kim Stebel commented on COUCHDB-1865:
-------------------------------------
I work on the documentation for Cloudant and we already have a way to integrate
testing with the documentation. I'm afraid it uses neither of your two ideas
though. The code is a number of tests that usually work like this:
- create a new db
- set up some state (how would you do this part if you only have to
documentation examples as input?)
- call the relevant API and see whether it does what we expect
- write request and response into ReST files that can be included in the
documentation.
- delete the db
The tests are written in Scala with a special branch of the "sprouch" library I
wrote, which uses Spray as the HTTP client library and ScalaTest to execute
tests.
I'll be working on automatically generating larger parts of the documentation
and I would be happy to contribute this work back to CouchDB. You can currently
find it at https://github.com/KimStebel/sprouch/tree/cloudant
> Use HTTP API examples as tests...
> ---------------------------------
>
> Key: COUCHDB-1865
> URL: https://issues.apache.org/jira/browse/COUCHDB-1865
> Project: CouchDB
> Issue Type: Improvement
> Components: Documentation, Test Suite
> Reporter: Alexander Shorin
>
> ...or use tests as HTTP API examples.
> First way is completely based on Sphinx ReST format: there is need to parse
> rst files, extract required directives and convert them to test cases. That's
> a Python way to go since it already contains package for parsing and
> operating with all required content.
> The second way it about using project like
> [katt|https://github.com/klarna/katt] which tests HTTP API by using
> human-readable files for test cases. Currently, their format is similar to
> Markdown, but I think it would be a problem to upgrade it to ReST, right?
> This way is completely Erlang`ish.
> First way is fast and cheap, but strict to sphinx docs content. Second is a
> bit longer, but doesn't binds to docs since only part of his tests will be
> used as base for docs.
> Which road better to go?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira