do not use unportable readlink utility to find the java_default_home,

use Ruby in a more portable fashion.

adapt tests as well
This commit is contained in:
Sebastian Reitenbach
2017-09-26 23:35:15 +02:00
committed by Will Meek
parent bdfc567c18
commit e50eb64614
4 changed files with 36 additions and 45 deletions

View File

@@ -7,7 +7,7 @@ describe Facter::Util::Fact do
describe "java_version" do
context 'returns java version when java present' do
context 'on OpenBSD', :with_env => true do
context 'on OpenBSD' do
before do
Facter.fact(:operatingsystem).stubs(:value).returns("OpenBSD")
end
@@ -61,7 +61,7 @@ Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
end
context 'returns nil when java not present' do
context 'on OpenBSD', :with_env => true do
context 'on OpenBSD' do
before do
Facter.fact(:operatingsystem).stubs(:value).returns("OpenBSD")
end