From 578eb951ea15490199437014dcf8d551b35e19da Mon Sep 17 00:00:00 2001 From: shuebnersr <32128158+shuebnersr@users.noreply.github.com> Date: Fri, 22 Sep 2017 11:50:41 +0200 Subject: [PATCH] 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 --- spec/unit/facter/java_version_spec.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/unit/facter/java_version_spec.rb b/spec/unit/facter/java_version_spec.rb index 92d627f..22be516 100644 --- a/spec/unit/facter/java_version_spec.rb +++ b/spec/unit/facter/java_version_spec.rb @@ -50,6 +50,7 @@ java version "1.7.0_71" Java(TM) SE Runtime Environment (build 1.7.0_71-b14) Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode) 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) expect(Facter.value(:java_version)).to eq("1.7.0_71") end