(#14764) Stub architecture fact when Windows facts run on Linux
Previously the Windows specific tests were failing when run on Linux
(but not Mac or Windows), because the processor fact always runs Linux,
Aix, and Solaris specific commands, causing the architecture fact to be
loaded, which loads the hardwaremodel, which was recently changed to use
WMI to retrieve the processor architecture instead of using RbConfig.
This commit just stubs the architecture fact until the processor fact
can be fixed to conditionally execute those commands based on the
current kernel fact.
Josh Cooper
11 years ago
15 | 15 | def load(procs) |
16 | 16 | require 'facter/util/wmi' |
17 | 17 | Facter::Util::WMI.stubs(:execquery).with("select * from Win32_Processor").returns(procs) |
18 | # This is to workaround #14674 | |
19 | Facter.fact(:architecture).stubs(:value).returns("x64") | |
18 | 20 | |
19 | 21 | # processor facts belong to a file with a different name, |
20 | 22 | # so load the file explicitly (after stubbing kernel), |