IO.popen does not support "-"
-----------------------------

                 Key: JRUBY-1895
                 URL: http://jira.codehaus.org/browse/JRUBY-1895
             Project: JRuby
          Issue Type: Sub-task
          Components: Core Classes/Modules
            Reporter: Charles Oliver Nutter
             Fix For: JRuby 1.1


popen("-") is not supported in JRuby yet

Error:

{noformat}
  5) Error:
test_s_popen_spawn(TestIO):
IOError: Cannot run program "-" (in directory 
"/Users/headius/NetBeansProjects/jruby"): -: not found
    
/Users/headius/NetBeansProjects/jruby/lib/ruby/1.8/test/unit/testcase.rb:78:in 
`run'
    
/Users/headius/NetBeansProjects/jruby/lib/ruby/1.8/test/unit/testsuite.rb:34:in 
`run'
    
/Users/headius/NetBeansProjects/jruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in 
`each'
    
/Users/headius/NetBeansProjects/jruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in 
`run'
    
/Users/headius/NetBeansProjects/jruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in 
`each'
    
/Users/headius/NetBeansProjects/jruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in 
`run'
    
/Users/headius/NetBeansProjects/jruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in 
`run_suite'
    
/Users/headius/NetBeansProjects/jruby/lib/ruby/1.8/test/unit/ui/testrunnermediator.rb:46:in
 `start_mediator'
    
/Users/headius/NetBeansProjects/jruby/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:41:in
 `start'
    
/Users/headius/NetBeansProjects/jruby/lib/ruby/1.8/test/unit/ui/testrunnerutilities.rb:29:in
 `run'
    
/Users/headius/NetBeansProjects/jruby/lib/ruby/1.8/test/unit/autorunner.rb:216:in
 `run'
    
/Users/headius/NetBeansProjects/jruby/lib/ruby/1.8/test/unit/autorunner.rb:12:in
 `run'
    /Users/headius/NetBeansProjects/jruby/lib/ruby/1.8/test/unit.rb:278:in `run'
    /Users/headius/NetBeansProjects/jruby/lib/ruby/1.8/test/unit.rb:276
{noformat}

Test:

{code}
  def test_s_popen_spawn
    unless WIN32
      # Spawn an interpreter - WRITE
      parent = $$
      pipe = IO.popen("-", "w")
      
      if pipe
        begin
          assert_equal(parent, $$)
          pipe.puts "12"
          Process.wait pipe.pid
          assert_equal(12, $?>>8)
        ensure
          pipe.close
        end
      else
        buff = $stdin.gets
        exit buff.to_i
      end
      
      # Spawn an interpreter - READWRITE
      parent = $$
      p = IO.popen("-", "w+")
      
      if p
        begin
          assert_equal(parent, $$)
          p.puts "Hello\n"
          assert_equal("Goodbye\n", p.gets)
          Process.wait
        ensure
          p.close
        end
      else
        puts "Goodbye" if $stdin.gets == "Hello\n"
        exit
      end
    end
  end   
{code}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to