File tree 2 files changed +5
-1
lines changed
2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -223,7 +223,9 @@ def sync
223
223
newparam ( :path ) do
224
224
desc "The search path used for command execution.
225
225
Commands must be fully qualified if no path is specified. Paths
226
- can be specified as an array or as a '#{ File ::PATH_SEPARATOR } ' separated list."
226
+ can be specified as an array or as a '#{ File ::PATH_SEPARATOR } ' separated list. Defaults to the `path` fact."
227
+
228
+ defaultto Puppet . runtime [ :facter ] . value ( 'path' )
227
229
228
230
# Support both arrays and colon-separated fields.
229
231
def value = ( *values )
Original file line number Diff line number Diff line change @@ -910,6 +910,8 @@ def instance(path)
910
910
let :abs do make_absolute ( '/bin/echo' ) end
911
911
let :path do make_absolute ( '/bin' ) end
912
912
913
+ allow ( Facter ) . to receive ( :value ) . with ( 'path' ) . and_return ( '/usr/bin:/bin' )
914
+
913
915
it "should fail with relative command and no path" do
914
916
expect { type . new ( :command => rel ) } .
915
917
to raise_error Puppet ::Error , /no path was specified/
You can’t perform that action at this time.
0 commit comments