Add ability to override basedir and package type

This commit is contained in:
Elyse Salberg
2018-07-09 16:16:34 -04:00
committed by Frank Wall
parent 1e8954727e
commit 82cd45647a
3 changed files with 112 additions and 20 deletions

View File

@@ -144,6 +144,37 @@ describe 'java::oracle', type: :define do
is_expected.to contain_archive('/tmp/jce-6.zip').with_extract_path('/usr/java/jdk1.6.0_99-amd64/jre/lib/security')
end
end
context 'when specifying package_type tar.gz and basedir' do
let(:params) do
{
ensure: 'present',
version: '6',
java_se: 'jdk',
basedir: '/usr/java',
package_type: 'tar.gz',
}
end
let(:title) { 'jdk6' }
it { is_expected.to contain_archive('/tmp/jdk-6u45-linux-x64.tar.gz') }
it { is_expected.to contain_exec('Install Oracle java_se jdk 6').with_command('tar -zxf /tmp/jdk-6u45-linux-x64.tar.gz -C /usr/java') }
it { is_expected.to contain_exec('Install Oracle java_se jdk 6').that_requires('Archive[/tmp/jdk-6u45-linux-x64.tar.gz]') }
end
context 'when manage_basedir is set to true' do
let(:params) do
{
ensure: 'present',
version: '6',
java_se: 'jdk',
basedir: '/usr/java',
manage_basedir: true,
}
end
let(:title) { 'jdk6' }
it { is_expected.to contain_file('/usr/java') }
end
end
context 'when on CentOS 32-bit' do