Permalink
Browse files

test EM::Connection#pause on popen connections

  • Loading branch information...
1 parent 5222bcd commit eae9baaef0fd5692b900e9eec1fb65ea998f41ab @rtomayko rtomayko committed Sep 1, 2011
Showing with 18 additions and 0 deletions.
  1. +18 −0 tests/test_processes.rb
View
@@ -99,6 +99,24 @@ def test_em_system_spaced_arguments
assert_equal("hello\n", $out)
end
+
+ def test_em_popen_pause_resume
+ c_rx = 0
+
+ test_client = Module.new do
+ define_method :receive_data do |data|
+ c_rx += 1
+ pause
+ EM.add_timer(0.5) { EM.stop }
+ end
+ end
+
+ EM.run{
+ EM.popen('cat /dev/random', test_client)
+ }
+
+ assert_equal 1, c_rx
+ end
else
warn "EM.popen not implemented, skipping tests in #{__FILE__}"

0 comments on commit eae9baa

Please sign in to comment.