forked from sous-chefs/java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoracle_jce_spec.rb
More file actions
40 lines (33 loc) · 1.22 KB
/
Copy pathoracle_jce_spec.rb
File metadata and controls
40 lines (33 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
require 'spec_helper'
describe 'java::oracle_jce' do
let(:chef_run) do
runner = ChefSpec::ServerRunner.new
runner.converge(described_recipe)
end
it 'downloads the JCE zip' do
expect(chef_run).to run_execute('download jce')
end
it 'extracts JCE zip' do
expect(chef_run).to run_execute('extract jce')
end
it 'Installs dependencies' do
expect(chef_run).to install_package('unzip')
expect(chef_run).to install_package('curl')
end
context 'Jar installation' do
let(:chef_run) do
runner = ChefSpec::ServerRunner.new do |node|
node.set['java']['java_home'] = '/usr/lib/jvm/java'
end
runner.converge(described_recipe)
end
it 'Deletes old jar file' do
expect(chef_run).to delete_file('/usr/lib/jvm/java/jre/lib/security/local_policy.jar')
expect(chef_run).to delete_file('/usr/lib/jvm/java/jre/lib/security/US_export_policy.jar')
end
it 'Links jars' do
expect(chef_run).to create_link('/usr/lib/jvm/java/jre/lib/security/local_policy.jar').with(to: '/opt/java_jce/6/local_policy.jar')
expect(chef_run).to create_link('/usr/lib/jvm/java/jre/lib/security/US_export_policy.jar').with(to: '/opt/java_jce/6/US_export_policy.jar')
end
end
end