add tests for the current an expected centos behaviour

This commit is contained in:
Gareth Rushgrove
2013-04-02 16:07:20 +01:00
parent 1d5c5992ab
commit 4b54bab0cb
3 changed files with 27 additions and 24 deletions

26
spec/classes/java_spec.rb Normal file
View File

@@ -0,0 +1,26 @@
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.7.0-openjdk') }
end
context 'select openjdk for Centos 6.3' do
let(:facts) { {:osfamily => 'RedHat', :operatingsystem => 'Centos', :operatingsystemrelease => '5.8'} }
it { should contain_package('java').with_name('java-1.7.0-openjdk') }
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('jdk') }
end
context 'select passed value for Centos 5.3' do
let(:facts) { {:osfamily => 'RedHat', :operatingsystem => 'Centos', :operatingsystemrelease => '5.3'} }
let(:params) { { 'distribution' => 'java-1.6.0-openjdk' } }
it { should contain_package('java').with_name('java-1.6.0-openjdk') }
end
end