Cucumber Features

Expand All

Collapse All

# language: en

Feature: Open Blocks

In order to group content in a generic container
As a writer
I want to be able to wrap content in an open block

features/open_block.feature:8

Scenario: Render an open block that contains a paragraph to HTML

  1. Given the AsciiDoc source
    features/step_definitions.rb:17
    --
    A paragraph in an open block.
    --
  2. When it is converted to html
    features/step_definitions.rb:21
  3. Then the result should match the HTML source
    features/step_definitions.rb:32
    <div class="openblock">
    <div class="content">
    <div class="paragraph">
    <p>A paragraph in an open block.</p>
    </div>
    </div>
    </div>
features/open_block.feature:28

Scenario: Render an open block that contains a paragraph to DocBook

  1. Given the AsciiDoc source
    features/step_definitions.rb:17
    --
    A paragraph in an open block.
    --
  2. When it is converted to docbook
    features/step_definitions.rb:28
  3. Then the result should match the XML source
    features/step_definitions.rb:32
    <simpara>A paragraph in an open block.</simpara>
features/open_block.feature:42

Scenario: Render an open block that contains a paragraph to HTML (alt)

  1. Given the AsciiDoc source
    features/step_definitions.rb:17
    --
    A paragraph in an open block.
    --
  2. When it is converted to html
    features/step_definitions.rb:21
  3. Then the result should match the HTML structure
    features/step_definitions.rb:36
    .openblock
      .content
        .paragraph
          p A paragraph in an open block.
features/open_block.feature:59

Scenario: Render an open block that contains a paragraph to DocBook (alt)

  1. Given the AsciiDoc source
    features/step_definitions.rb:17
    --
    A paragraph in an open block.
    --
  2. When it is converted to docbook
    features/step_definitions.rb:28
  3. Then the result should match the XML structure
    features/step_definitions.rb:36
    simpara A paragraph in an open block.
features/open_block.feature:73

Scenario: Render an open block that contains a list to HTML

  1. Given the AsciiDoc source
    features/step_definitions.rb:17
    --
    * one
    * two
    * three
    --
  2. When it is converted to html
    features/step_definitions.rb:21
  3. Then the result should match the HTML structure
    features/step_definitions.rb:36
    .openblock
      .content
        .ulist
          ul
            li: p one
            li: p two
            li: p three
# language: en

Feature: Open Blocks

In order to pass content through unprocessed
As a writer
I want to be able to mark passthrough content using a pass block

features/pass_block.feature:8

Scenario: Render a pass block without performing substitutions by default to HTML

  1. Given the AsciiDoc source
    features/step_definitions.rb:17
    :name: value
    
    ++++
    <p>{name}</p>
    
    image:tiger.png[]
    ++++
  2. When it is converted to html
    features/step_definitions.rb:21
  3. Then the result should match the HTML source
    features/step_definitions.rb:32
    <p>{name}</p>
    
    image:tiger.png[]
features/pass_block.feature:28

Scenario: Render a pass block without performing substitutions by default to DocBook

  1. Given the AsciiDoc source
    features/step_definitions.rb:17
    :name: value
    
    ++++
    <simpara>{name}</simpara>
    
    image:tiger.png[]
    ++++
  2. When it is converted to docbook
    features/step_definitions.rb:28
  3. Then the result should match the XML source
    features/step_definitions.rb:32
    <simpara>{name}</simpara>
    
    image:tiger.png[]
features/pass_block.feature:48

Scenario: Render a pass block performing explicit substitutions to HTML

  1. Given the AsciiDoc source
    features/step_definitions.rb:17
    :name: value
    
    [subs="attributes,macros"]
    ++++
    <p>{name}</p>
    
    image:tiger.png[]
    ++++
  2. When it is converted to html
    features/step_definitions.rb:21
  3. Then the result should match the HTML source
    features/step_definitions.rb:32
    <p>value</p>
    
    <span class="image"><img src="tiger.png" alt="tiger"></span>
# language: en

Feature: Text Formatting

In order to apply formatting to the text
As a writer
I want to be able to markup inline text with formatting characters

features/text_formatting.feature:8

Scenario: Convert text that contains superscript and subscript characters

  1. Given the AsciiDoc source
    features/step_definitions.rb:17
    _v_~rocket~ is the value
    ^3^He is the isotope
    log~4~x^n^ is the expression
    M^me^ White is the address
    the 10^th^ point has coordinate (x~10~, y~10~)
  2. When it is converted to html
    features/step_definitions.rb:21
  3. Then the result should match the HTML source
    features/step_definitions.rb:32
    <div class="paragraph">
    <p><em>v</em><sub>rocket</sub> is the value
    <sup>3</sup>He is the isotope
    log<sub>4</sub>x<sup>n</sup> is the expression
    M<sup>me</sup> White is the address
    the 10<sup>th</sup> point has coordinate (x<sub>10</sub>, y<sub>10</sub>)</p>
    </div>
features/text_formatting.feature:30

Scenario: Convert text that has ex-inline literal formatting

  1. Given the AsciiDoc source
    features/step_definitions.rb:17
    Use [x-]`{asciidoctor-version}` to print the version of Asciidoctor.
  2. When it is converted to html
    features/step_definitions.rb:21
  3. Then the result should match the HTML source
    features/step_definitions.rb:32
    <div class="paragraph">
    <p>Use <code>{asciidoctor-version}</code> to print the version of Asciidoctor.</p>
    </div>
features/text_formatting.feature:44

Scenario: Convert text that has ex-inline monospaced formatting

  1. Given the AsciiDoc source
    features/step_definitions.rb:17
    The document is assumed to be encoded as [x-]+{encoding}+.
  2. When it is converted to html
    features/step_definitions.rb:21
  3. Then the result should match the HTML source
    features/step_definitions.rb:32
    <div class="paragraph">
    <p>The document is assumed to be encoded as <code>UTF-8</code>.</p>
    </div>
# language: en

Feature: Cross References

In order to create links to other sections
As a writer
I want to be able to use a cross reference macro

features/xref.feature:8

Scenario: Create a cross reference from an AsciiDoc cell to a section

  1. Given the AsciiDoc source
    features/step_definitions.rb:17
    |===
    a|See <<_install>>
    |===
    
    == Install
    
    Instructions go here.
  2. When it is converted to html
    features/step_definitions.rb:21
  3. Then the result should match the HTML structure
    features/step_definitions.rb:36
    table.tableblock.frame-all.grid-all.spread
      colgroup
        col style='width: 100%;'
      tbody
        tr
          td.tableblock.halign-left.valign-top
            div
              .paragraph: p
                'See
                a href='#_install' Install
    .sect1
      h2#_install Install
      .sectionbody
        .paragraph: p Instructions go here.
features/xref.feature:39

Scenario: Create a cross reference using the target section title

  1. Given the AsciiDoc source
    features/step_definitions.rb:17
    == Section One
    
    content
    
    == Section Two
    
    refer to <<Section One>>
  2. When it is converted to html
    features/step_definitions.rb:21
  3. Then the result should match the HTML structure
    features/step_definitions.rb:36
    .sect1
      h2#_section_one Section One
      .sectionbody: .paragraph: p content
    .sect1
      h2#_section_two Section Two
      .sectionbody: .paragraph: p
        'refer to
        a href='#_section_one' Section One
features/xref.feature:64

Scenario: Create a cross reference using the target reftext

  1. Given the AsciiDoc source
    features/step_definitions.rb:17
    [reftext="the first section"]
    == Section One
    
    content
    
    == Section Two
    
    refer to <<the first section>>
  2. When it is converted to html
    features/step_definitions.rb:21
  3. Then the result should match the HTML structure
    features/step_definitions.rb:36
    .sect1
      h2#_section_one Section One
      .sectionbody: .paragraph: p content
    .sect1
      h2#_section_two Section Two
      .sectionbody: .paragraph: p
        'refer to
        a href='#_section_one' the first section
features/xref.feature:90

Scenario: Create a cross reference using the formatted target title

  1. Given the AsciiDoc source
    features/step_definitions.rb:17
    == Section *One*
    
    content
    
    == Section Two
    
    refer to <<Section *One*>>
  2. When it is converted to html
    features/step_definitions.rb:21
  3. Then the result should match the HTML structure
    features/step_definitions.rb:36
    .sect1
      h2#_section_strong_one_strong
        'Section
        strong One
      .sectionbody: .paragraph: p content
    .sect1
      h2#_section_two Section Two
      .sectionbody: .paragraph: p
        'refer to
        a href='#_section_strong_one_strong'
          'Section
          strong One