I have a custom fact in ruby that uses Facter::Core::Execution.execute
to execute a system command and sets the fact to true or false based on the output of the execute command. Is there a way I could mock the output of the execute command to test it?
Using rspec:
expect(Facter::Core::Execution).to receive(:execute).and_return(true)