File: vector_install_spec.rb

package info (click to toggle)
puppet-module-jhbigler-vector 1.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 388 kB
  • sloc: ruby: 511; sh: 67; makefile: 4
file content (45 lines) | stat: -rw-r--r-- 1,091 bytes parent folder | download
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
39
40
41
42
43
44
45
# frozen_string_literal: true

require 'spec_helper'

describe 'vector::install' do
    let(:pre_condition) { 'include vector' }

    #Test that we install vector by default
    context 'normal' do 
        it do
            is_expected.to contain_package('vector')
                .with({'ensure' => 'present'})
        end
    end

    #Test that we can set the vector verion
    context 'specific vector version' do
        let(:pre_condition) do
            <<-EOS
                class {'vector':
                    version => '1.0.0',
                }
            EOS
        end

        it do
            is_expected.to contain_package('vector')
                .with({'ensure' => '1.0.0'})
        end
    end

    #Test that no 'vector' package present when install_vector is false
    context 'no install vector' do
        let(:pre_condition) do 
            <<-EOS
                class {'vector':
                    install_vector => false,
                }
            EOS
        end

        it { expect(catalogue.resource('package', 'vector')).to be_nil }

    end
end