Sha256: f98f2195fc354099598ed83985f868103b0bd31ca019900d9be23aefe4ae15cc
Contents?: true
Size: 654 Bytes
Versions: 8
Compression:
Stored size: 654 Bytes
Contents
$:.unshift "../lib" require 'eventmachine' require 'test/unit' class TestDeferrable < Test::Unit::TestCase class Later include EM::Deferrable end def test_timeout_without_args $args = "unset" EM.run { df = Later.new df.timeout(0.2) df.errback { $args = "none" } EM.add_timer(0.5) { EM.stop } } assert_equal("none", $args) end def test_timeout_with_args $args = "unset" EM.run { df = Later.new df.timeout(0.2, :timeout, :foo) df.errback { |type, name| $args = [type, name] } EM.add_timer(0.5) { EM.stop } } assert_equal([:timeout, :foo], $args) end end
Version data entries
8 entries across 8 versions & 3 rubygems