From ecc63a0a28c362ddf4797d3be27a1660c1fa0d94 Mon Sep 17 00:00:00 2001 From: Rafael Chicoli Date: Tue, 26 Jan 2016 19:26:29 +0100 Subject: fix all puppet-lint error messages --- spec/classes/example_spec.rb | 35 -------------------- spec/classes/gitlab_ci_multi_runner_spec.rb | 50 +++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 35 deletions(-) delete mode 100644 spec/classes/example_spec.rb create mode 100644 spec/classes/gitlab_ci_multi_runner_spec.rb (limited to 'spec') diff --git a/spec/classes/example_spec.rb b/spec/classes/example_spec.rb deleted file mode 100644 index 7dc8942..0000000 --- a/spec/classes/example_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -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 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..f23ab90 --- /dev/null +++ b/spec/classes/gitlab_ci_multi_runner_spec.rb @@ -0,0 +1,50 @@ +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') } + 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 -- cgit v1.2.3