Sha256: 5ed032a4df5e2b9d150b0b2a07eeb934b5d58536e23913ea5e242795477e643f

Contents?: true

Size: 558 Bytes

Versions: 11

Compression:

Stored size: 558 Bytes

Contents

require 'helper'
require 'fiber'

describe EventMachine::HttpRequest do
  context "with fibers" do

    it "should be transparent to connection errors" do
      EventMachine.run do
        Fiber.new do
          f = Fiber.current
          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

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
em-http-request-samesite-0.1.1 spec/client_fiber_spec.rb
em-http-request-samesite-1.1.7 spec/client_fiber_spec.rb
em-http-request-1.1.7 spec/client_fiber_spec.rb
em-http-request-1.1.6 spec/client_fiber_spec.rb
em-http-request-1.1.5 spec/client_fiber_spec.rb
em-http-request-1.1.4 spec/client_fiber_spec.rb
em-http-request-1.1.3 spec/client_fiber_spec.rb
em-http-request-1.1.2 spec/client_fiber_spec.rb
em-http-request-1.1.1 spec/client_fiber_spec.rb
em-http-request-1.1.0 spec/client_fiber_spec.rb
em-http-request-1.0.3 spec/client_fiber_spec.rb