diff options
author | Jeoffrey B <jeoffrey54@gmail.com> | 2016-01-28 10:45:14 +0100 |
---|---|---|
committer | Jeoffrey B <jeoffrey54@gmail.com> | 2016-01-28 10:45:14 +0100 |
commit | 2b5f5f257d950091b5a5a515daab7addea39025b (patch) | |
tree | e81ff8445b167c62c36e217c857d518a0be6fc98 /spec/classes/gitlab_ci_multi_runner_spec.rb | |
parent | a89c460e0f630d778513a3b07a33f150b79d2aae (diff) | |
parent | c45d8e2f43919785134f02ca34c98ca943c82166 (diff) |
Merge pull request #1 from rchicoli/fix-travis-ci
fix all puppet-lint error messages
Diffstat (limited to 'spec/classes/gitlab_ci_multi_runner_spec.rb')
-rw-r--r-- | spec/classes/gitlab_ci_multi_runner_spec.rb | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/spec/classes/gitlab_ci_multi_runner_spec.rb b/spec/classes/gitlab_ci_multi_runner_spec.rb new file mode 100644 index 0000000..2092e9f --- /dev/null +++ b/spec/classes/gitlab_ci_multi_runner_spec.rb @@ -0,0 +1,56 @@ +require 'spec_helper' + +describe 'gitlab_ci_multi_runner', :type => :class do + + ['Debian', 'RedHat'].each do |osfamily| + context "on #{osfamily}" do + + if osfamily == 'Debian' + describe "gitlab_ci_multi_runner class without any parameters on #{osfamily}" do + let(:params) {{ }} + let(:facts) {{ + :osfamily => 'Debian', + :concat_basedir => '/dne', + :operatingsystem => 'Debian', + :lsbdistid => 'Debian', + :lsbdistcodename => 'jessie', + :operatingsystemmajrelease => '8', + }} + + 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_class('apt') } + it { should contain_package('apt-transport-https').that_comes_before('Apt::Source[gitlab-ci-multi-runner]').that_comes_before('Package[gitlab-ci-multi-runner]') } + it { should contain_apt__source('gitlab-ci-multi-runner').with_location('https://packages.gitlab.com/runner/gitlab-ci-multi-runner/debian/') } + + it { should contain_service('gitlab-runner') } + it { should contain_package('gitlab-ci-multi-runner').with_name('gitlab-ci-multi-runner').with_ensure('present') } + + it { should contain_package('apt-transport-https').with_ensure('present') } + + context 'with service_enable set to false' do + let(:params) { {'service_enable' => false} } + it { should_not contain_service('gitlab-ci-multi-runner') } + end + + end + 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 |