|
229 | 229 | end.should output_to_fd(Process.getpgid(Process.pid).to_s) |
230 | 230 | end |
231 | 231 |
|
232 | | - it "joins the current process if :pgroup => false" do |
| 232 | + it "joins the current process if :pgroup is false" do |
233 | 233 | lambda do |
234 | 234 | Process.wait @object.spawn(ruby_cmd("print Process.getpgid(Process.pid)"), :pgroup => false) |
235 | 235 | end.should output_to_fd(Process.getpgid(Process.pid).to_s) |
236 | 236 | end |
237 | 237 |
|
238 | | - it "joins the current process if :pgroup => nil" do |
| 238 | + it "joins the current process if :pgroup is nil" do |
239 | 239 | lambda do |
240 | 240 | Process.wait @object.spawn(ruby_cmd("print Process.getpgid(Process.pid)"), :pgroup => nil) |
241 | 241 | end.should output_to_fd(Process.getpgid(Process.pid).to_s) |
242 | 242 | end |
243 | 243 |
|
244 | | - it "joins a new process group if :pgroup => true" do |
| 244 | + it "joins a new process group if :pgroup is true" do |
245 | 245 | process = lambda do |
246 | 246 | Process.wait @object.spawn(ruby_cmd("print Process.getpgid(Process.pid)"), :pgroup => true) |
247 | 247 | end |
|
250 | 250 | process.should output_to_fd(/\d+/) |
251 | 251 | end |
252 | 252 |
|
253 | | - it "joins a new process group if :pgroup => 0" do |
| 253 | + it "joins a new process group if :pgroup is 0" do |
254 | 254 | process = lambda do |
255 | 255 | Process.wait @object.spawn(ruby_cmd("print Process.getpgid(Process.pid)"), :pgroup => 0) |
256 | 256 | end |
|
259 | 259 | process.should output_to_fd(/\d+/) |
260 | 260 | end |
261 | 261 |
|
262 | | - it "joins the specified process group if :pgroup => pgid" do |
| 262 | + it "joins the specified process group if :pgroup is pgid" do |
263 | 263 | lambda do |
264 | 264 | Process.wait @object.spawn(ruby_cmd("print Process.getpgid(Process.pid)"), :pgroup => 123) |
265 | 265 | end.should_not output_to_fd("123") |
|
334 | 334 |
|
335 | 335 | # redirection |
336 | 336 |
|
337 | | - it "redirects STDOUT to the given file descriptior if :out => Fixnum" do |
| 337 | + it "redirects STDOUT to the given file descriptior if :out is Fixnum" do |
338 | 338 | File.open(@name, 'w') do |file| |
339 | 339 | lambda do |
340 | 340 | Process.wait @object.spawn(ruby_cmd("print :glark"), :out => file.fileno) |
341 | 341 | end.should output_to_fd("glark", file) |
342 | 342 | end |
343 | 343 | end |
344 | 344 |
|
345 | | - it "redirects STDOUT to the given file if :out => IO" do |
| 345 | + it "redirects STDOUT to the given file if :out is IO" do |
346 | 346 | File.open(@name, 'w') do |file| |
347 | 347 | lambda do |
348 | 348 | Process.wait @object.spawn(ruby_cmd("print :glark"), :out => file) |
349 | 349 | end.should output_to_fd("glark", file) |
350 | 350 | end |
351 | 351 | end |
352 | 352 |
|
353 | | - it "redirects STDOUT to the given file if :out => String" do |
| 353 | + it "redirects STDOUT to the given file if :out is String" do |
354 | 354 | Process.wait @object.spawn(ruby_cmd("print :glark"), :out => @name) |
355 | 355 | @name.should have_data("glark") |
356 | 356 | end |
357 | 357 |
|
358 | | - it "redirects STDERR to the given file descriptior if :err => Fixnum" do |
| 358 | + it "redirects STDERR to the given file descriptior if :err is Fixnum" do |
359 | 359 | File.open(@name, 'w') do |file| |
360 | 360 | lambda do |
361 | 361 | Process.wait @object.spawn(ruby_cmd("STDERR.print :glark"), :err => file.fileno) |
362 | 362 | end.should output_to_fd("glark", file) |
363 | 363 | end |
364 | 364 | end |
365 | 365 |
|
366 | | - it "redirects STDERR to the given file descriptor if :err => IO" do |
| 366 | + it "redirects STDERR to the given file descriptor if :err is IO" do |
367 | 367 | File.open(@name, 'w') do |file| |
368 | 368 | lambda do |
369 | 369 | Process.wait @object.spawn(ruby_cmd("STDERR.print :glark"), :err => file) |
370 | 370 | end.should output_to_fd("glark", file) |
371 | 371 | end |
372 | 372 | end |
373 | 373 |
|
374 | | - it "redirects STDERR to the given file if :err => String" do |
| 374 | + it "redirects STDERR to the given file if :err is String" do |
375 | 375 | Process.wait @object.spawn(ruby_cmd("STDERR.print :glark"), :err => @name) |
376 | 376 | @name.should have_data("glark") |
377 | 377 | end |
378 | 378 |
|
379 | | - it "redirects STDERR to child STDOUT if :err => [:child, :out]" do |
| 379 | + it "redirects STDERR to child STDOUT if :err is [:child, :out]" do |
380 | 380 | File.open(@name, 'w') do |file| |
381 | 381 | lambda do |
382 | 382 | Process.wait @object.spawn(ruby_cmd("STDERR.print :glark"), :out => file, :err => [:child, :out]) |
|
410 | 410 | @name.should have_data("") |
411 | 411 | end |
412 | 412 |
|
413 | | - context "when passed :close_others => true" do |
| 413 | + context "when passed :close_others is true" do |
414 | 414 | before :each do |
415 | 415 | @output = tmp("spawn_close_others_true") |
416 | 416 | @options = { :close_others => true } |
|
453 | 453 | end |
454 | 454 | end |
455 | 455 |
|
456 | | - context "when passed :close_others => false" do |
| 456 | + context "when passed :close_others is false" do |
457 | 457 | before :each do |
458 | 458 | @output = tmp("spawn_close_others_false") |
459 | 459 | @options = { :close_others => false } |
|
0 commit comments