class Puppet::Util::ExecutionStub
Public Class Methods
current_value()
click to toggle source
Retrieve the current execution stub, or nil if there is no stub.
# File lib/puppet/util/execution_stub.rb 22 def current_value 23 @value 24 end
reset()
click to toggle source
Uninstall any execution stub, so that calls to Puppet::Util::Execution.execute() behave normally again.
# File lib/puppet/util/execution_stub.rb 17 def reset 18 @value = nil 19 end
set(&block)
click to toggle source
Set a stub block that Puppet::Util::Execution.execute() should invoke instead of actually executing commands on the target machine. Intended for spec testing.
The arguments passed to the block are |command, options|, where command is an array of strings and options is an options hash.
# File lib/puppet/util/execution_stub.rb 11 def set(&block) 12 @value = block 13 end