Skip to content
Browse files

Correctly fix #228 - race condition in test.

  • Loading branch information...
1 parent e510f57 commit eeb7f129b2881455b92086e727ecda190e7abd4c @raggi raggi committed Aug 1, 2011
Showing with 9 additions and 6 deletions.
  1. +9 −6 tests/test_threaded_resource.rb
View
15 tests/test_threaded_resource.rb
@@ -14,12 +14,15 @@ def teardown
end
def test_dispatch_completion
- completion = resource.dispatch do |o|
- o[:foo] = :bar
- :foo
- end
- completion.callback do |result|
- assert_equal :foo, result
+ EM.run do
+ completion = resource.dispatch do |o|
+ o[:foo] = :bar
+ :foo
+ end
+ completion.callback do |result|
+ assert_equal :foo, result
+ EM.stop
+ end
end
assert_equal :bar, object[:foo]
end

0 comments on commit eeb7f12

Please sign in to comment.
Something went wrong with that request. Please try again.