This repository has been archived by the owner on Dec 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
These facts have since been refactored, ported these changes from https://github.com/puppetlabs/puppetlabs-java/
- Loading branch information
Showing
3 changed files
with
41 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
require "spec_helper" | ||
|
||
describe Facter::Util::Fact do | ||
before { | ||
Facter.clear | ||
} | ||
|
||
describe "java_major_version" do | ||
context "if java is not installed" do | ||
context 'returns java major version extracted from java_version fact' do | ||
before :each do | ||
allow(Facter.fact(:java_version)).to receive(:value).and_return("1.7.0_71") | ||
end | ||
it do | ||
Facter.fact(:java_major_version).value.should == "7" | ||
end | ||
end | ||
end | ||
|
||
context "if java is not installed" do | ||
context 'returns nil' do | ||
before :each do | ||
allow(Facter.fact(:java_version)).to receive(:value).and_return(nil) | ||
end | ||
it do | ||
Facter.fact(:java_major_version).value.should == nil | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters