diff options
author | Jeoffrey Bauvin <jeoffrey.bauvin.ext@boursorama.fr> | 2015-10-26 11:52:35 +0100 |
---|---|---|
committer | Jeoffrey Bauvin <jeoffrey.bauvin.ext@boursorama.fr> | 2015-10-26 11:52:35 +0100 |
commit | 9e34914cc75d5c8199538abcae59a486a2282eb3 (patch) | |
tree | 862e2ad188985ab31cfbfc17ec0f6d2f2a732e00 /spec/classes | |
parent | e1146e11669136fb06e53112a8db9d674130a6f9 (diff) |
Add skeleton
Diffstat (limited to 'spec/classes')
-rw-r--r-- | spec/classes/coverage_spec.rb | 1 | ||||
-rw-r--r-- | spec/classes/example_spec.rb | 35 |
2 files changed, 36 insertions, 0 deletions
diff --git a/spec/classes/coverage_spec.rb b/spec/classes/coverage_spec.rb new file mode 100644 index 0000000..12513b8 --- /dev/null +++ b/spec/classes/coverage_spec.rb @@ -0,0 +1 @@ +at_exit { RSpec::Puppet::Coverage.report! } diff --git a/spec/classes/example_spec.rb b/spec/classes/example_spec.rb new file mode 100644 index 0000000..7dc8942 --- /dev/null +++ b/spec/classes/example_spec.rb @@ -0,0 +1,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 |