Sha256: 77991efe9bbf65d68f88c0d1844af09375c9019c824aff97eecc335b2fce6714

Contents?: true

Size: 413 Bytes

Versions: 4

Compression:

Stored size: 413 Bytes

Contents

require_relative 'em_test_helper'

class TestShutdownHooks < Test::Unit::TestCase
  def test_shutdown_hooks
    r = false
    EM.run {
      EM.add_shutdown_hook { r = true }
      EM.stop
    }
    assert_equal( true, r )
  end

  def test_hook_order
    r = []
    EM.run {
      EM.add_shutdown_hook { r << 2 }
      EM.add_shutdown_hook { r << 1 }
      EM.stop
    }
    assert_equal( [1, 2], r )
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
eventmachine-mkroman-1.3.0.dev.1 tests/test_shutdown_hooks.rb
wj_eventmachine-1.3.2 tests/test_shutdown_hooks.rb
wj_eventmachine-1.3.1 tests/test_shutdown_hooks.rb
wj_eventmachine-1.3.0.dev.1 tests/test_shutdown_hooks.rb