anchor.diff:  +
   and run `bundle install`.
   
  -. Create or edit `test/test_helper.rb`; require test dependencies and setup paths:
  +. Create or edit `test/test_helper.rb`; require test dependencies and setup `examples_path`:
   +
   [source]
   ----
   require 'asciidoctor/doctest'
   require 'minitest/autorun'
  +
  +# used to colorize output
   require 'minitest/rg'
  +
  +# needed if you're testing templates-based backend
   require 'tilt'
   
  -# Setup paths
  +# extra input examples (optional)
  +Asciidoctor::DocTest.examples_path.unshift 'test/examples/asciidoc'
  +
  +# output examples
   Asciidoctor::DocTest.examples_path.unshift 'test/examples/shiny'
   ----
   
  -. Create test file `test/templates_test.rb`, extend one of the DocTest’s test
  -classes and call `generate_tests!` macro:
  +. Create test file `test/templates_test.rb`, extend one of the DocTest’s test classes, set `backend` to use and/or `templates_path` and _then_ call `generate_tests!` macro:
   +
   [source]
   ----
  
positive.code: 
  ----
  
  === HTML
  
  [source, html]
  ----
  
negative.code: :idseparator: -
  :source-language: ruby
  :language: {source-language}
  // links
  :doctor-man-uri: http://asciidoctor.org/docs/user-manual
  :src-base: lib/asciidoctor/doctest
  
  image:https://badge.fury.io/rb/asciidoctor-doctest.svg[Gem Version, link="http://badge.fury.io/rb/asciidoctor-doctest"] image:https://codeclimate.com/github/asciidoctor/asciidoctor-doctest/badges/gpa.svg[Code Climate, link="https://codeclimate.com/github/asciidoctor/asciidoctor-doctest"] image:http://inch-ci.org/github/asciidoctor/asciidoctor-doctest.svg?branch=master[Inline docs, link="http://inch-ci.org/github/asciidoctor/asciidoctor-doctest"] image:https://img.shields.io/badge/yard-docs-blue.svg[Yard Docs, link="http://www.rubydoc.info/github/asciidoctor/asciidoctor-doctest/frames"]
  
  DocTest is a tool for easy end-to-end testing of Asciidoctor _backends_ (i.e. converters/renderers) based on comparing of textual output.
  It provides a collection of categorized “scenario-oriented” input _examples_ (documents in AsciiDoc syntax) to simplify and systematize writing tests for new backends — you just have to write (or generate) the expected output.
  
  image::https://cdn.rawgit.com/asciidoctor/asciidoctor-doctest/master/doc/img/doctest-diag.svg[diagram]
  
  DocTest uses a pragmatic approach that tries to minimize efforts with writing and maintaining of integration tests for custom backends.
  
  Both input and output _examples_ are simple to write and read – they are just fragments of documents in AsciiDoc and plain HTML, TeX or whatever syntax your backend produces.
  The output examples can be even (pre)generated if you already have at least partially working backend.
  
  Each example is focused (more or less) on one use case, so when writing a new backend, you can incrementally implement new features following the reference input examples.
  However, they are not strictly isolated like unit tests — when you change e.g. format of a paragraph, it may affect also examples outside of the block_paragraph.
  
  If you want to change something, you can adjust the desired output in examples and _then_ fix the backend to go back to green.
  When test fails, it prints a nicely formatted diff of the expected and actual output, so you can see what exactly is wrong.
  
  DocTest currently supports HTML-based backends and can be easily extended to support any other backend with textual output.
  
  
  == Setup DocTest
  
  Let’s say that you’re developing a new shiny HTML template-based backend named simply “shiny” and assume that you have templates in the directory `data/templates`.
  
  . Create a directory for your output examples:
  +
  [source, sh]
  mkdir -p test/examples/shiny
  +
  and optionally a directory for your extra input examples:
  +
  [source, sh]
  mkdir -p test/examples/asciidoc
  
  . Add development dependency on `asciidoctor-doctest` to your gemspec:
  +
  