diff --git a/test/TC_FXApp.rb b/test/TC_FXApp.rb
index 11ca3438028df6650c13142147abe4ef7c0c2289..717f1e5472b9aadf288f3fd8f1684b30b04e74ad 100755
--- a/test/TC_FXApp.rb
+++ b/test/TC_FXApp.rb
@@ -33,11 +33,11 @@ class TC_FXApp2 < TestCase
       pipe_wr.write " "
     end
     app.run
+    assert data_sent, "the read input event shouldn't fire before some data is available"
+
     app.removeInput(pipe_rd, INPUT_READ)
     pipe_wr.close
-    pipe_rd.close
-
-    assert data_sent, "the read input event shouldn't fire before some data is available"
+    pipe_rd.close unless pipe_rd.closed?
   end
 
   def test_addInput_on_pipe
@@ -52,4 +52,9 @@ class TC_FXApp2 < TestCase
 
     check_events pipe_rd, pipe_wr
   end
+
+  def test_addInput_on_popen
+    pipe_rdwr = IO.popen("cat", "r+")
+    check_events pipe_rdwr, pipe_rdwr
+  end
 end