Class: Puppet::Util::ExecutionStub

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet/util/execution_stub.rb

Class Method Summary collapse

Class Method Details

.current_valueObject

Retrieve the current execution stub, or nil if there is no stub.



21
22
23
# File 'lib/puppet/util/execution_stub.rb', line 21

def current_value
  @value
end

.resetObject

Uninstall any execution stub, so that calls to Puppet::Util::Execution.execute() behave normally again.



16
17
18
# File 'lib/puppet/util/execution_stub.rb', line 16

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.



10
11
12
# File 'lib/puppet/util/execution_stub.rb', line 10

def set(&block)
  @value = block
end