Skip to content

Commit

Permalink
Correctly fix eventmachine#228 - race condition in test.
Browse files Browse the repository at this point in the history
  • Loading branch information
raggi committed Aug 1, 2011
1 parent e510f57 commit eeb7f12
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions tests/test_threaded_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit eeb7f12

Please sign in to comment.