Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion spec/acceptance/install_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def apply_manifest_wheezy_case(pp)
end
end

context 'failure cases' do
context 'with failure cases' do
# C14711
# SLES 10 returns an exit code of 0 on zypper failure
unless fact('operatingsystem') == 'SLES' && fact('operatingsystemrelease') < '11'
Expand Down
78 changes: 39 additions & 39 deletions spec/classes/java_spec.rb

Large diffs are not rendered by default.

48 changes: 24 additions & 24 deletions spec/defines/oracle_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
oracle_url = 'http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz'

describe 'java::oracle', type: :define do
context 'On CentOS 64-bit' do
context 'with CentOS 64-bit' do
let(:facts) { { kernel: 'Linux', os: { family: 'RedHat', architecture: 'x86_64', name: 'CentOS', release: { full: '6.0' } } } }

context 'Oracle Java SE 6 JDK' do
context 'when Oracle Java SE 6 JDK' do
let(:params) { { ensure: 'present', version: '6', java_se: 'jdk' } }
let(:title) { 'jdk6' }

Expand All @@ -15,7 +15,7 @@
it { is_expected.to contain_exec('Install Oracle java_se jdk 6').that_requires('Archive[/tmp/jdk-6u45-linux-x64-rpm.bin]') }
end

context 'Oracle Java SE 7 JDK' do
context 'when Oracle Java SE 7 JDK' do
let(:params) { { ensure: 'present', version: '7', java_se: 'jdk' } }
let(:title) { 'jdk7' }

Expand All @@ -24,7 +24,7 @@
it { is_expected.to contain_exec('Install Oracle java_se jdk 7').that_requires('Archive[/tmp/jdk-7u80-linux-x64.rpm]') }
end

context 'Oracle Java SE 8 JDK' do
context 'when Oracle Java SE 8 JDK' do
let(:params) { { ensure: 'present', version: '8', java_se: 'jdk' } }
let(:title) { 'jdk8' }

Expand All @@ -33,7 +33,7 @@
it { is_expected.to contain_exec('Install Oracle java_se jdk 8').that_requires('Archive[/tmp/jdk-8u131-linux-x64.rpm]') }
end

context 'Oracle Java SE 6 JRE' do
context 'when Oracle Java SE 6 JRE' do
let(:params) { { ensure: 'present', version: '6', java_se: 'jre' } }
let(:title) { 'jre6' }

Expand All @@ -42,7 +42,7 @@
it { is_expected.to contain_exec('Install Oracle java_se jre 6').that_requires('Archive[/tmp/jre-6u45-linux-x64-rpm.bin]') }
end

context 'Oracle Java SE 7 JRE' do
context 'when Oracle Java SE 7 JRE' do
let(:params) { { ensure: 'present', version: '7', java_se: 'jre' } }
let(:title) { 'jre7' }

Expand All @@ -51,7 +51,7 @@
it { is_expected.to contain_exec('Install Oracle java_se jre 7').that_requires('Archive[/tmp/jre-7u80-linux-x64.rpm]') }
end

context 'select Oracle Java SE 8 JRE' do
context 'when select Oracle Java SE 8 JRE' do
let(:params) { { ensure: 'present', version: '8', java_se: 'jre' } }
let(:title) { 'jre8' }

Expand All @@ -60,7 +60,7 @@
it { is_expected.to contain_exec('Install Oracle java_se jre 8').that_requires('Archive[/tmp/jre-8u131-linux-x64.rpm]') }
end

context 'Pass URL to url parameter' do
context 'when passing URL to url parameter' do
let(:params) do
{
ensure: 'present',
Expand All @@ -79,7 +79,7 @@
}
end

context 'Pass a hash to url_hash parameter' do
context 'when passing a hash to url_hash parameter' do
let(:params) do
{
ensure: 'present',
Expand All @@ -95,10 +95,10 @@
end
end

context 'On CentOS 32-bit' do
context 'when on CentOS 32-bit' do
let(:facts) { { kernel: 'Linux', os: { family: 'RedHat', architecture: 'i386', name: 'CentOS', release: { full: '6.6' } } } }

context 'select Oracle Java SE 6 JDK on RedHat family, 32-bit' do
context 'when selecting Oracle Java SE 6 JDK on RedHat family, 32-bit' do
let(:params) { { ensure: 'present', version: '6', java_se: 'jdk' } }
let(:title) { 'jdk6' }

Expand All @@ -107,7 +107,7 @@
it { is_expected.to contain_exec('Install Oracle java_se jdk 6').that_requires('Archive[/tmp/jdk-6u45-linux-i586-rpm.bin]') }
end

context 'select Oracle Java SE 7 JDK on RedHat family, 32-bit' do
context 'when selecting Oracle Java SE 7 JDK on RedHat family, 32-bit' do
let(:params) { { ensure: 'present', version: '7', java_se: 'jdk' } }
let(:title) { 'jdk7' }

Expand All @@ -116,7 +116,7 @@
it { is_expected.to contain_exec('Install Oracle java_se jdk 7').that_requires('Archive[/tmp/jdk-7u80-linux-i586.rpm]') }
end

context 'select Oracle Java SE 8 JDK on RedHat family, 32-bit' do
context 'when selecting Oracle Java SE 8 JDK on RedHat family, 32-bit' do
let(:params) { { ensure: 'present', version: '8', java_se: 'jdk' } }
let(:title) { 'jdk8' }

Expand All @@ -125,7 +125,7 @@
it { is_expected.to contain_exec('Install Oracle java_se jdk 8').that_requires('Archive[/tmp/jdk-8u131-linux-i586.rpm]') }
end

context 'select Oracle Java SE 6 JRE on RedHat family, 32-bit' do
context 'when selecting Oracle Java SE 6 JRE on RedHat family, 32-bit' do
let(:params) { { ensure: 'present', version: '6', java_se: 'jre' } }
let(:title) { 'jdk6' }

Expand All @@ -134,7 +134,7 @@
it { is_expected.to contain_exec('Install Oracle java_se jre 6').that_requires('Archive[/tmp/jre-6u45-linux-i586-rpm.bin]') }
end

context 'select Oracle Java SE 7 JRE on RedHat family, 32-bit' do
context 'when select Oracle Java SE 7 JRE on RedHat family, 32-bit' do
let(:params) { { ensure: 'present', version: '7', java_se: 'jre' } }
let(:title) { 'jdk7' }

Expand All @@ -143,7 +143,7 @@
it { is_expected.to contain_exec('Install Oracle java_se jre 7').that_requires('Archive[/tmp/jre-7u80-linux-i586.rpm]') }
end

context 'select Oracle Java SE 8 JRE on RedHat family, 32-bit' do
context 'when select Oracle Java SE 8 JRE on RedHat family, 32-bit' do
let(:params) { { ensure: 'present', version: '8', java_se: 'jre' } }
let(:title) { 'jdk8' }

Expand All @@ -153,10 +153,10 @@
end
end

context 'On Ubuntu 64-bit' do
context 'with Ubuntu 64-bit' do
let(:facts) { { kernel: 'Linux', os: { family: 'Debian', architecture: 'amd64', name: 'Ubuntu', release: { full: '16.04' } } } }

context 'Oracle Java SE 6 JDK' do
context 'when Oracle Java SE 6 JDK' do
let(:params) { { ensure: 'present', version: '6', java_se: 'jdk' } }
let(:title) { 'jdk6' }

Expand All @@ -165,7 +165,7 @@
it { is_expected.to contain_exec('Install Oracle java_se jdk 6').that_requires('Archive[/tmp/jdk-6u45-linux-x64.tar.gz]') }
end

context 'Oracle Java SE 7 JDK' do
context 'with Oracle Java SE 7 JDK' do
let(:params) { { ensure: 'present', version: '7', java_se: 'jdk' } }
let(:title) { 'jdk7' }

Expand All @@ -174,7 +174,7 @@
it { is_expected.to contain_exec('Install Oracle java_se jdk 7').that_requires('Archive[/tmp/jdk-7u80-linux-x64.tar.gz]') }
end

context 'Oracle Java SE 8 JDK' do
context 'with Oracle Java SE 8 JDK' do
let(:params) { { ensure: 'present', version: '8', java_se: 'jdk' } }
let(:title) { 'jdk8' }

Expand All @@ -183,7 +183,7 @@
it { is_expected.to contain_exec('Install Oracle java_se jdk 8').that_requires('Archive[/tmp/jdk-8u131-linux-x64.tar.gz]') }
end

context 'Oracle Java SE 6 JRE' do
context 'with Oracle Java SE 6 JRE' do
let(:params) { { ensure: 'present', version: '6', java_se: 'jre' } }
let(:title) { 'jre6' }

Expand All @@ -192,7 +192,7 @@
it { is_expected.to contain_exec('Install Oracle java_se jre 6').that_requires('Archive[/tmp/jre-6u45-linux-x64.tar.gz]') }
end

context 'Oracle Java SE 7 JRE' do
context 'when Oracle Java SE 7 JRE' do
let(:params) { { ensure: 'present', version: '7', java_se: 'jre' } }
let(:title) { 'jre7' }

Expand All @@ -201,7 +201,7 @@
it { is_expected.to contain_exec('Install Oracle java_se jre 7').that_requires('Archive[/tmp/jre-7u80-linux-x64.tar.gz]') }
end

context 'select Oracle Java SE 8 JRE' do
context 'when Oracle Java SE 8 JRE' do
let(:params) { { ensure: 'present', version: '8', java_se: 'jre' } }
let(:title) { 'jre8' }

Expand All @@ -210,7 +210,7 @@
it { is_expected.to contain_exec('Install Oracle java_se jre 8').that_requires('Archive[/tmp/jre-8u131-linux-x64.tar.gz]') }
end

context 'Pass URL to url parameter' do
context 'when passing URL to url parameter' do
let(:params) { { ensure: 'present', version_major: '8u131', version_minor: 'b11', java_se: 'jdk', url: oracle_url.to_s } }
let(:title) { 'jdk8' }

Expand Down
4 changes: 2 additions & 2 deletions spec/unit/facter/java_default_home_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def symlink_and_test(symlink_path, java_home)
Facter.fact(:kernel).stubs(:value).returns('Linux')
end

context 'returns java home path when java found in PATH' do
context 'when java found in PATH' do
context 'when java is in /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java' do
it do
unlink_and_delete('./java_test')
Expand All @@ -44,7 +44,7 @@ def symlink_and_test(symlink_path, java_home)
end
end

context 'returns nil when java not present' do
context 'when java not present, return nil' do
it do
Facter::Util::Resolution.stubs(:exec)
Facter::Util::Resolution.expects(:which).with('java').at_least(1).returns(false)
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/facter/java_libjvm_path_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Dir.stubs(:glob).with("#{java_default_home}/jre/lib/**/libjvm.so").returns(['/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so'])
end

context 'returns libjvm path on Linux' do
context 'when on Linux, return libjvm path' do
it do
expect(Facter.value(:java_libjvm_path)).to eql '/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server'
end
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/facter/java_major_version_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Facter.clear
end

context 'returns major version when java_version fact present' do
context 'when java_version fact present, returns major version' do
before :each do
Facter.fact(:java_version).stubs(:value).returns('1.7.0_71')
end
Expand All @@ -14,7 +14,7 @@
end
end

context 'returns nil when java not present' do
context 'when java not present, returns nil' do
before :each do
Facter.fact(:java_version).stubs(:value).returns(nil)
end
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/facter/java_patch_level_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Facter.clear
end

context 'if java is installed returns java patch version extracted from java_version fact' do
context 'when java is installed returns java patch version extracted from java_version fact' do
before :each do
Facter.fact(:java_version).stubs(:value).returns('1.7.0_71')
end
Expand All @@ -14,7 +14,7 @@
end
end

context 'if java is not installed returns nil' do
context 'when java is not installed returns nil' do
before :each do
Facter.fact(:java_version).stubs(:value).returns(nil)
end
Expand Down
12 changes: 6 additions & 6 deletions spec/unit/facter/java_version_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
Facter.clear
end

context 'returns java version when java present' do
context 'when java present, returns java version' do
context 'on OpenBSD', with_env: true do
before(:each) do
Facter.fact(:operatingsystem).stubs(:value).returns('OpenBSD')
Expand All @@ -28,7 +28,7 @@
expect(Facter.value(:java_version)).to eq('1.7.0_71')
end
end
context 'on Darwin' do
context 'when on Darwin' do
before(:each) do
Facter.fact(:operatingsystem).stubs(:value).returns('Darwin')
end
Expand All @@ -40,7 +40,7 @@
expect(Facter.value(:java_version)).to eql '1.7.0_71'
end
end
context 'on other systems' do
context 'when on other systems' do
before(:each) do
Facter.fact(:operatingsystem).stubs(:value).returns('MyOS')
end
Expand All @@ -54,7 +54,7 @@
end
end

context 'returns nil when java not present' do
context 'when java not present, returns nil' do
context 'on OpenBSD', with_env: true do
before(:each) do
Facter.fact(:operatingsystem).stubs(:value).returns('OpenBSD')
Expand All @@ -66,7 +66,7 @@
expect(Facter.value(:java_version)).to be_nil
end
end
context 'on Darwin' do
context 'when on Darwin' do
before(:each) do
Facter.fact(:operatingsystem).stubs(:value).returns('Darwin')
end
Expand All @@ -77,7 +77,7 @@
expect(Facter.value(:java_version)).to be_nil
end
end
context 'on other systems' do
context 'when on other systems' do
before(:each) do
Facter.fact(:operatingsystem).stubs(:value).returns('MyOS')
end
Expand Down