Sha256: aa06b8d636317d642710ecdbc01b8efe9c598ff64ee644a24b9b8e0e71204a8b

Contents?: true

Size: 737 Bytes

Versions: 56

Compression:

Stored size: 737 Bytes

Contents

module Puppet::Util
  class ExecutionStub
    class << self
      # Set a stub block that Puppet::Util.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.
      def set(&block)
        @value = block
      end

      # Uninstall any execution stub, so that calls to
      # Puppet::Util.execute() behave normally again.
      def reset
        @value = nil
      end

      # Retrieve the current execution stub, or nil if there is no stub.
      def current_value
        @value
      end
    end
  end
end

Version data entries

56 entries across 56 versions & 4 rubygems

Version Path
puppet-parse-0.1.4 lib/vendor/puppet/util/execution_stub.rb
puppet-parse-0.1.3 lib/vendor/puppet/util/execution_stub.rb
puppet-parse-0.1.2 lib/vendor/puppet/util/execution_stub.rb
puppet-parse-0.1.1 lib/vendor/puppet/util/execution_stub.rb
puppet-2.7.26 lib/puppet/util/execution_stub.rb
puppet-2.7.25 lib/puppet/util/execution_stub.rb
puppet-2.7.24 lib/puppet/util/execution_stub.rb
puppet-2.7.23 lib/puppet/util/execution_stub.rb
puppet-2.7.22 lib/puppet/util/execution_stub.rb
puppet-parse-0.1.0 lib/vendor/puppet/util/execution_stub.rb
puppet-parse-0.0.6 lib/vendor/puppet/util/execution_stub.rb
puppet-2.7.21 lib/puppet/util/execution_stub.rb
puppet-2.6.18 lib/puppet/util/execution_stub.rb
puppet-parse-0.0.5 lib/vendor/puppet/util/execution_stub.rb
puppet-parse-0.0.4 lib/vendor/puppet/util/execution_stub.rb
puppet-parse-0.0.2 lib/vendor/puppet/util/execution_stub.rb
puppet-2.7.20 lib/puppet/util/execution_stub.rb
puppet-2.7.20.rc1 lib/puppet/util/execution_stub.rb
librarian-puppet-0.9.4 vendor/gems/ruby/1.8/gems/puppet-2.7.18/lib/puppet/util/execution_stub.rb
puppet-2.7.19 lib/puppet/util/execution_stub.rb