Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

test EM::Connection#pause on popen connections

  • Loading branch information...
commit eae9baaef0fd5692b900e9eec1fb65ea998f41ab 1 parent 5222bcd
@rtomayko rtomayko authored
Showing with 18 additions and 0 deletions.
  1. +18 −0 tests/test_processes.rb
View
18 tests/test_processes.rb
@@ -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__}"
Please sign in to comment.
Something went wrong with that request. Please try again.