Sha256: b3e1d87e78843bdddc455ac3b8106389c9948142aabcfdbc25dd282a3b81ca4d

Contents?: true

Size: 404 Bytes

Versions: 136

Compression:

Stored size: 404 Bytes

Contents

require '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

136 entries across 133 versions & 9 rubygems

Version Path
devcycle-ruby-server-sdk-1.1.0 examples/sinatra/vendor/bundle/ruby/3.0.0/gems/eventmachine-1.2.7/tests/test_shutdown_hooks.rb
devcycle-ruby-server-sdk-1.1.0 examples/sinatra/vendor/bundle/ruby/3.1.0/gems/eventmachine-1.2.7/tests/test_shutdown_hooks.rb
devcycle-ruby-server-sdk-1.1.0 examples/sinatra/vendor/bundle/ruby/2.6.0/gems/eventmachine-1.2.7/tests/test_shutdown_hooks.rb
sensu-em-2.7.0-java tests/test_shutdown_hooks.rb
eventmachine-1.2.7-java tests/test_shutdown_hooks.rb
eventmachine-1.2.7-x64-mingw32 tests/test_shutdown_hooks.rb
eventmachine-1.2.7-x86-mingw32 tests/test_shutdown_hooks.rb
eventmachine-1.2.7 tests/test_shutdown_hooks.rb
eventmachine-1.2.6-x64-mingw32 tests/test_shutdown_hooks.rb
eventmachine-1.2.6-x86-mingw32 tests/test_shutdown_hooks.rb
eventmachine-1.2.6-java tests/test_shutdown_hooks.rb
eventmachine-1.2.6 tests/test_shutdown_hooks.rb
eventmachine-1.2.5-x86-mingw32 tests/test_shutdown_hooks.rb
eventmachine-1.2.5-x64-mingw32 tests/test_shutdown_hooks.rb
eventmachine-1.2.5-java tests/test_shutdown_hooks.rb
eventmachine-1.2.5 tests/test_shutdown_hooks.rb
eventmachine-1.2.3-x64-mingw32 tests/test_shutdown_hooks.rb
eventmachine-1.2.3-x86-mingw32 tests/test_shutdown_hooks.rb
eventmachine-1.2.3-java tests/test_shutdown_hooks.rb
eventmachine-1.2.3 tests/test_shutdown_hooks.rb