diff --git a/manifests/repo.pp b/manifests/repo.pp index f7b8ae30..b02e65ae 100644 --- a/manifests/repo.pp +++ b/manifests/repo.pp @@ -7,7 +7,7 @@ case $facts['os']['family'] { 'Debian': { # no contain here because apt does that already - case $facts['os']['family'] { + case $facts['os']['name'] { 'Debian': { include ::php::repo::debian } diff --git a/spec/classes/php_repo_spec.rb b/spec/classes/php_repo_spec.rb new file mode 100644 index 00000000..79429fcc --- /dev/null +++ b/spec/classes/php_repo_spec.rb @@ -0,0 +1,27 @@ +require 'spec_helper' + +describe 'php::repo', type: :class do + on_supported_os.each do |os, facts| + context "on #{os}" do + let :facts do + facts + end + + describe 'when configuring a package repo' do + case facts[:osfamily] + when 'Debian' + case facts[:operatingsystem] + when 'Debian' + it { is_expected.to contain_class('php::repo::debian') } + when 'Ubuntu' + it { is_expected.to contain_class('php::repo::ubuntu') } + end + when 'Suse' + it { is_expected.to contain_class('php::repo::suse') } + when 'RedHat' + it { is_expected.to contain_class('php::repo::redhat') } + end + end + end + end +end