asciidoctor / asciidoctor-extensions-lab

A lab for testing and demonstrating Asciidoctor extensions. Please do not use this code in production. If you want to use one of these extensions in your application, create a new project, import the code, and distribute it as a RubyGem. You can then request to make it a top-level project under the Asciidoctor organization.
Other
105 stars 101 forks source link

Unit test extension for source blocks #14

Open mojavelinux opened 9 years ago

mojavelinux commented 9 years ago

It would be interested to demonstrate how to create an extension for AsciiDoc that ran through all the source listings and verified the expected output. This is an inside-out-approach from pulling snippets from a test suite. Different circumstances call for different approaches.

Since the extension has to run the assertions, it will likely be language-specific. We should focus on Ruby or JavaScript in the example.

Here's the inspiration for this extension (though it uses really quirky syntax which I'd like to improve on).

http://www.jspatterns.com/unit-testing-in-asciidoc/