We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0c3745e commit 13d27efCopy full SHA for 13d27ef
spec/ruby/core/process/spawn_spec.rb
@@ -212,6 +212,24 @@
212
end.should output_to_fd("nil\n")
213
end
214
215
+ it "uses the passed env['PATH'] to search the executable" do
216
+ dir = tmp("spawn_path_dir")
217
+ mkdir_p dir
218
+ begin
219
+ exe = 'process-spawn-executable-in-path'
220
+ path = "#{dir}/#{exe}"
221
+ File.write(path, "#!/bin/sh\necho $1")
222
+ File.chmod(0755, path)
223
+
224
+ env = { "PATH" => "#{dir}#{File::PATH_SEPARATOR}#{ENV['PATH']}" }
225
+ Process.wait Process.spawn(env, exe, 'OK', out: @name)
226
+ $?.should.success?
227
+ File.read(@name).should == "OK\n"
228
+ ensure
229
+ rm_r dir
230
+ end
231
232
233
it "calls #to_hash to convert the environment" do
234
o = mock("to_hash")
235
o.should_receive(:to_hash).and_return({"FOO" => "BAR"})
0 commit comments