Skip to content

Commit

Permalink
test EM::Connection#pause on popen connections
Browse files Browse the repository at this point in the history
  • Loading branch information
rtomayko committed Sep 1, 2011
1 parent 5222bcd commit eae9baa
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/test_processes.rb
Expand Up @@ -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__}"

Expand Down

0 comments on commit eae9baa

Please sign in to comment.