File: doc_spec.rb

package info (click to toggle)
puppet-agent 8.10.0-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 27,404 kB
  • sloc: ruby: 286,820; sh: 492; xml: 116; makefile: 88; cs: 68
file content (34 lines) | stat: -rw-r--r-- 935 bytes parent folder | download | duplicates (2)
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
require 'spec_helper'
require 'puppet/application/doc'

describe Puppet::Application::Doc do
  include PuppetSpec::Files

  let(:app) { Puppet::Application[:doc] }

  it 'lists references' do
    app.command_line.args = ['-l']
    expect {
      app.run
    }.to exit_with(0)
     .and output(/configuration - A reference for all settings/).to_stdout
  end

  {
    'configuration' => /# Configuration Reference/,
    'function'      => /# Function Reference/,
    'indirection'   => /# Indirection Reference/,
    'metaparameter' => /# Metaparameter Reference/,
    'providers'     => /# Provider Suitability Report/,
    'report'        => /# Report Reference/,
    'type'          => /# Type Reference/
  }.each_pair do |type, expected|
    it "generates #{type} reference" do
      app.command_line.args = ['-r', type]
      expect {
        app.run
      }.to exit_with(0)
       .and output(expected).to_stdout
    end
  end
end