fix java_version test for other systems
mock Facter::Util::Resolution.which('java') for the "other systems" test; before it was not mocked and was based on Java being installed on the test system or not
This commit is contained in:
@@ -50,6 +50,7 @@ java version "1.7.0_71"
|
|||||||
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
|
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
|
||||||
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
|
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
|
||||||
EOS
|
EOS
|
||||||
|
Facter::Util::Resolution.expects(:which).with("java").returns('/path/to/java')
|
||||||
Facter::Util::Resolution.expects(:exec).with("java -Xmx12m -version 2>&1").returns(java_version_output)
|
Facter::Util::Resolution.expects(:exec).with("java -Xmx12m -version 2>&1").returns(java_version_output)
|
||||||
expect(Facter.value(:java_version)).to eq("1.7.0_71")
|
expect(Facter.value(:java_version)).to eq("1.7.0_71")
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user