root/version_0/tests/test_next_tick.rb
| Revision 649, 1.1 kB (checked in by blackhedd, 1 year ago) | |
|---|---|
| |
| Line | |
|---|---|
| 1 | # $Id$ |
| 2 | # |
| 3 | # Author:: Francis Cianfrocca (gmail: blackhedd) |
| 4 | # Homepage:: http://rubyeventmachine.com |
| 5 | # Date:: 8 April 2006 |
| 6 | # |
| 7 | # See EventMachine and EventMachine::Connection for documentation and |
| 8 | # usage examples. |
| 9 | # |
| 10 | #---------------------------------------------------------------------------- |
| 11 | # |
| 12 | # Copyright (C) 2006-07 by Francis Cianfrocca. All Rights Reserved. |
| 13 | # Gmail: blackhedd |
| 14 | # |
| 15 | # This program is free software; you can redistribute it and/or modify |
| 16 | # it under the terms of either: 1) the GNU General Public License |
| 17 | # as published by the Free Software Foundation; either version 2 of the |
| 18 | # License, or (at your option) any later version; or 2) Ruby's License. |
| 19 | # |
| 20 | # See the file COPYING for complete licensing information. |
| 21 | # |
| 22 | #--------------------------------------------------------------------------- |
| 23 | # |
| 24 | # |
| 25 | # |
| 26 | # |
| 27 | |
| 28 | $:.unshift "../lib" |
| 29 | require 'eventmachine' |
| 30 | require 'test/unit' |
| 31 | |
| 32 | |
| 33 | |
| 34 | class TestNextTick < Test::Unit::TestCase |
| 35 | |
| 36 | def setup |
| 37 | end |
| 38 | |
| 39 | def teardown |
| 40 | end |
| 41 | |
| 42 | def test_tick_arg |
| 43 | pr = proc {EM.stop} |
| 44 | EM.epoll |
| 45 | EM.run { |
| 46 | EM.next_tick pr |
| 47 | } |
| 48 | assert true |
| 49 | end |
| 50 | |
| 51 | def test_tick_block |
| 52 | EM.epoll |
| 53 | EM.run { |
| 54 | EM.next_tick {EM.stop} |
| 55 | } |
| 56 | assert true |
| 57 | end |
| 58 | end |
Note: See TracBrowser for help on using the browser.
