File: index.md

package info (click to toggle)
ruby-rspec-puppet 2.9.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,416 kB
  • sloc: ruby: 6,661; makefile: 6
file content (37 lines) | stat: -rw-r--r-- 664 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
---
layout: base
title: Testing Classes
icon: fa fa-book
breadcrumbs:
    -
        name: Documentation
        path: /documentation/
---

## Basic Test Structure

Tests for classes should be placed in files under `spec/classes/`. For
example the tests for `apache::install` should be in
`spec/classes/apache_install_spec.rb`.

{% highlight ruby %}
require 'spec_helper'

describe '<class name>' do
  # let(:params) { ... }

  # it { is_expected.to ... }
end
{% endhighlight %}

## Configuring The Tests

{% include non_host_inputs.md %}

{% include common_inputs.md %}

{% include facts_inputs.md %}

## Testing The Catalogue

{% include catalogue_matchers.md %}