diff --git a/manifests/version.pp b/manifests/version.pp index 581fdde6f..f3cec4259 100644 --- a/manifests/version.pp +++ b/manifests/version.pp @@ -19,7 +19,7 @@ } } 'Debian': { - if $::operatingsystem == 'Ubuntu' and $distrelease >= 13.10 { + if $::operatingsystem == 'Ubuntu' and $::operatingsystemrelease >= 13.10 { $default = 2.4 } else { $default = 2.2 diff --git a/spec/classes/apache_spec.rb b/spec/classes/apache_spec.rb index 1a9a58d1b..b43792897 100644 --- a/spec/classes/apache_spec.rb +++ b/spec/classes/apache_spec.rb @@ -140,6 +140,39 @@ it { should contain_file("/etc/apache2/apache2.conf").with_content %r{^Group www-data\n} } end end + + context "on Ubuntu" do + let :facts do + super().merge({ + :operatingsystem => 'Ubuntu' + }) + end + + context "13.10" do + let :facts do + super().merge({ + :operatingsystemrelease => '13.10' + }) + end + it { should contain_class('apache').with_apache_version('2.4') } + end + context "12.04" do + let :facts do + super().merge({ + :operatingsystemrelease => '12.04' + }) + end + it { should contain_class('apache').with_apache_version('2.2') } + end + context "13.04" do + let :facts do + super().merge({ + :operatingsystemrelease => '13.04' + }) + end + it { should contain_class('apache').with_apache_version('2.2') } + end + end end context "on a RedHat 5 OS" do let :facts do