From 85524dcd2cffdadba2f09eb5bcca39a5dbc24a8b Mon Sep 17 00:00:00 2001 From: Lars Kanis <lars@greiz-reinsdorf.de> Date: Sat, 8 Oct 2011 21:54:53 +0200 Subject: [PATCH] add FXApp#addInput test with IO#popen --- test/TC_FXApp.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/TC_FXApp.rb b/test/TC_FXApp.rb index 11ca343..717f1e5 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 -- GitLab