summaryrefslogtreecommitdiff
path: root/spec/classes/example_spec.rb
blob: 7dc894201b38266d560aa451e8122f613b23246d (plain)
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
require 'spec_helper'

describe 'gitlab_ci_multi_runner' do
  context 'supported operating systems' do
    ['Debian', 'RedHat'].each do |osfamily|
      describe "gitlab_ci_multi_runner class without any parameters on #{osfamily}" do
        let(:params) {{ }}
        let(:facts) {{
          :osfamily => osfamily,
        }}

        it { should compile.with_all_deps }

        it { should contain_class('gitlab_ci_multi_runner::params') }
        it { should contain_class('gitlab_ci_multi_runner::install').that_comes_before('gitlab_ci_multi_runner::config') }
        it { should contain_class('gitlab_ci_multi_runner::config') }
        it { should contain_class('gitlab_ci_multi_runner::service').that_subscribes_to('gitlab_ci_multi_runner::config') }

        it { should contain_service('gitlab_ci_multi_runner') }
        it { should contain_package('gitlab_ci_multi_runner').with_ensure('present') }
      end
    end
  end

  context 'unsupported operating system' do
    describe 'gitlab_ci_multi_runner class without any parameters on Solaris/Nexenta' do
      let(:facts) {{
        :osfamily        => 'Solaris',
        :operatingsystem => 'Nexenta',
      }}

      it { expect { should contain_package('gitlab_ci_multi_runner') }.to raise_error(Puppet::Error, /Nexenta not supported/) }
    end
  end
end