Sha256: 5b3140c9b63189cbe69a89f5077d4da94fc5fa6a707bbddd39d7b070006532b3

Contents?: true

Size: 359 Bytes

Versions: 5

Compression:

Stored size: 359 Bytes

Contents

require 'test/unit'
require 'posix-spawn'

class PopenTest < Test::Unit::TestCase
  include POSIX::Spawn

  def test_popen4
    pid, i, o, e = popen4("cat")
    i.write "hello world"
    i.close
    ::Process.wait(pid)

    assert_equal o.read, "hello world"
    assert_equal $?.exitstatus, 0
  ensure
    [i, o, e].each{ |io| io.close rescue nil }
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
posix-spawn-0.3.5 test/test_popen.rb
posix-spawn-0.3.3 test/test_popen.rb
posix-spawn-0.3.2 test/test_popen.rb
posix-spawn-0.3.1 test/test_popen.rb
posix-spawn-0.3.0 test/test_popen.rb