File: datacat_spec.rb

package info (click to toggle)
puppet-module-richardc-datacat 0.6.2-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 208 kB
  • sloc: ruby: 417; sh: 10; makefile: 4
file content (27 lines) | stat: -rw-r--r-- 1,023 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
require 'spec_helper'

describe "datacat" do
  context "specifying template by path" do
    let(:title) { 'test' }
    let(:params) { { :template => "demo1/sheeps.erb" } }
    it { should contain_datacat_collector('test') }
    it { should contain_datacat_collector('test').with_template('demo1/sheeps.erb') }
    it { should contain_datacat_collector('test').with_template_body(/baah/) }
  end

  context "specifying template by body" do
    let(:title) { 'test' }
    let(:params) { { :template_body => "# Baah!" } }
    it { should contain_datacat_collector('test') }
    it { should contain_datacat_collector('test').with_template('inline') }
    it { should contain_datacat_collector('test').with_template_body(/Baah/) }
  end

  context "specifying ensure absent" do
    let(:title) { 'no-file' }
    let(:params) { { :ensure => "absent" } }
    it { should_not contain_datacat_collector('no-file') }
    it { should contain_file('no-file') }
    it { should contain_file('no-file').with_ensure('absent') }
  end
end