Skip to content
Browse files

add a check in fiber spec

  • Loading branch information...
1 parent 27b7c9a commit ce50f322ce08d43a4a747cf333ea576765d764c4 @igrigorik committed Jan 7, 2012
Showing with 10 additions and 8 deletions.
  1. +10 −8 spec/client_fiber_spec.rb
View
18 spec/client_fiber_spec.rb
@@ -3,19 +3,21 @@
describe EventMachine::HttpRequest do
context "with fibers" do
- it "should be transparent to connexion errors" do
+
+ it "should be transparent to connection errors" do
EventMachine.run do
Fiber.new do
f = Fiber.current
- http = EventMachine::HttpRequest.new('http://non-existing.domain/').get
- http.callback {failed(http)}
- http.errback {f.resume}
- Fiber.yield
- EventMachine.stop
+ fired = false
+ http = EventMachine::HttpRequest.new('http://non-existing.domain/', :connection_timeout => 0.1).get
+ http.callback { failed(http) }
+ http.errback { f.resume :errback }
+
+ Fiber.yield.should == :errback
+ EM.stop
end.resume
end
end
+
end
end
-
-

0 comments on commit ce50f32

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