Class: Puppet::Util::ExecutionStub
- Defined in:
- lib/puppet/util/execution_stub.rb
Class Method Summary collapse
-
.current_value ⇒ Object
Retrieve the current execution stub, or nil if there is no stub.
-
.reset ⇒ Object
Uninstall any execution stub, so that calls to Puppet::Util::Execution.execute() behave normally again.
-
.set(&block) ⇒ Object
Set a stub block that Puppet::Util::Execution.execute() should invoke instead of actually executing commands on the target machine.
Class Method Details
.current_value ⇒ Object
Retrieve the current execution stub, or nil if there is no stub.
23 24 25 |
# File 'lib/puppet/util/execution_stub.rb', line 23 def current_value @value end |
.reset ⇒ Object
Uninstall any execution stub, so that calls to Puppet::Util::Execution.execute() behave normally again.
18 19 20 |
# File 'lib/puppet/util/execution_stub.rb', line 18 def reset @value = nil end |
.set(&block) ⇒ Object
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.
12 13 14 |
# File 'lib/puppet/util/execution_stub.rb', line 12 def set(&block) @value = block end |