File: reference_spec.rb

package info (click to toggle)
puppet-agent 7.23.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 19,092 kB
  • sloc: ruby: 245,074; sh: 456; makefile: 38; xml: 33
file content (38 lines) | stat: -rw-r--r-- 1,510 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
require 'spec_helper'
require 'puppet/util/reference'

describe Puppet::Util::Reference do
  it "should create valid Markdown extension definition lists" do
    my_fragment = nil
    Puppet::Util::Reference.newreference :testreference, :doc => "A peer of the type and configuration references, but with no useful information" do
      my_term = "A term"
      my_definition = <<-EOT
        The definition of this term, marked by a colon and a space.
        We should be able to handle multi-line definitions. Each subsequent
        line should left-align with the first word character after the colon
        used as the definition marker.

        We should be able to handle multi-paragraph definitions.

        Leading indentation should be stripped from the definition, which allows
        us to indent the source string for cosmetic purposes.
      EOT
      my_fragment = markdown_definitionlist(my_term, my_definition)
    end
    Puppet::Util::Reference.reference(:testreference).send(:to_markdown, true)
    expect(my_fragment).to eq <<-EOT
A term
: The definition of this term, marked by a colon and a space.
  We should be able to handle multi-line definitions. Each subsequent
  line should left-align with the first word character after the colon
  used as the definition marker.

  We should be able to handle multi-paragraph definitions.

  Leading indentation should be stripped from the definition, which allows
  us to indent the source string for cosmetic purposes.

    EOT
  end

end