Files
puppetlabs-java/spec/classes/java_spec.rb
Brett Porter cde7046e99 Merge branch 'fixes_for_centos_versions' of https://github.com/garethr/puppetlabs-java into garethr-fixes_for_centos_versions
Conflicts:
	Modulefile
	README.markdown
	manifests/init.pp
	spec/spec_helper.rb
2013-06-02 21:47:19 -07:00

32 lines
1.3 KiB
Ruby

require 'spec_helper'
describe 'java', :type => :class do
context 'select openjdk for Centos 5.8' do
let(:facts) { {:osfamily => 'RedHat', :operatingsystem => 'Centos', :operatingsystemrelease => '5.8'} }
it { should contain_package('java').with_name('java-1.6.0-openjdk-devel') }
end
context 'select openjdk for Centos 6.3' do
let(:facts) { {:osfamily => 'RedHat', :operatingsystem => 'Centos', :operatingsystemrelease => '6.3'} }
it { should contain_package('java').with_name('java-1.7.0-openjdk-devel') }
end
context 'select openjdk for Centos 6.2' do
let(:facts) { {:osfamily => 'RedHat', :operatingsystem => 'Centos', :operatingsystemrelease => '6.2'} }
it { should contain_package('java').with_name('java-1.6.0-openjdk-devel') }
end
context 'select passed value for Centos 5.3' do
let(:facts) { {:osfamily => 'RedHat', :operatingsystem => 'Centos', :operatingsystemrelease => '5.3'} }
let(:params) { { 'package' => 'jdk' } }
it { should contain_package('java').with_name('jdk') }
end
context 'select default for Centos 5.3' do
let(:facts) { {:osfamily => 'RedHat', :operatingsystem => 'Centos', :operatingsystemrelease => '5.3'} }
it { should contain_package('java').with_name('java-1.6.0-openjdk-devel') }
end
end