class TestMonitor

Public Instance Methods

listen_one(monitor) click to toggle source
# File vendor/qwik/lib/qwik/site-monitor.rb, line 70
def listen_one(monitor)
  monitor.listen(nil) {|ev|
    return ev
  }
end
test_monitors() click to toggle source
# File vendor/qwik/lib/qwik/site-monitor.rb, line 76
def test_monitors
  monitor = @site.sitemonitor

  t1 = Thread.new {
    ev = listen_one(monitor)
    ok_eq(1, ev)
  }

  t2 = Thread.new {
    ev = listen_one(monitor)
    ok_eq(1, ev)
  }

  sleep 0.01
  monitor.shout(1)

  t1.join
  t2.join
end